Java FileOutputStream Create getOutputStream(File file, String filePath)

Here you can find the source of getOutputStream(File file, String filePath)

Description

get Output Stream

License

Open Source License

Parameter

Parameter Description
file a parameter
filePath a parameter

Return

OutputStream

Declaration

public static OutputStream getOutputStream(File file, String filePath) 

Method Source Code


//package com.java2s;
/*/*from  w ww.j  av a 2  s . c  o m*/
 * $RCSfile: FileUtil,v $$
 * $Revision: 1.0  $
 * $Date: 2011  $
 *
 * Copyright (C) 2011 GyTech, Inc. All rights reserved.
 *
 * This software is the proprietary information of GyTech, Inc.
 * Use is subject to license terms.
 */

import java.io.File;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import java.io.OutputStream;

public class Main {
    /** 
     * @param file  
     * @param filePath 
     * @return OutputStream
     */
    public static OutputStream getOutputStream(File file, String filePath) {
        try {
            return new FileOutputStream(filePath + "/" + file.getName());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. getOutputStream(File file)
  2. getOutputStream(File file)
  3. getOutputStream(final File file)
  4. getOutputStream(final File file)
  5. getOutputStream(final Object obj, final boolean append)
  6. getOutputStream(String file)