Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/main/com/mongodb/gridfs/GridFS.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,37 @@ public GridFSInputFile createFile( InputStream in , String filename ){
return new GridFSInputFile( this , in , filename );
}

/**
* This method creates an empty {@link GridFSInputFile} instance. On this
* instance an {@link java.io.OutputStream} can be obtained using the
* {@link GridFSInputFile#getOutputStream()} method. You can still call
* {@link GridFSInputFile#setContentType(String)} and
* {@link GridFSInputFile#setFilename(String)}. The file will be completely
* written and closed after calling the {@link java.io.OutputStream#close()}
* method on the output stream.
*
* @param filename
* Name of the file to be created.
* @return GridFS file handle instance.
*/
public GridFSInputFile createFile(String filename) {
return new GridFSInputFile( this , filename );
}

/**
* This method creates an empty {@link GridFSInputFile} instance. On this
* instance an {@link java.io.OutputStream} can be obtained using the
* {@link GridFSInputFile#getOutputStream()} method. You can still call
* {@link GridFSInputFile#setContentType(String)} and
* {@link GridFSInputFile#setFilename(String)}. The file will be completely
* written and closed after calling the {@link java.io.OutputStream#close()}
* method on the output stream.
*
* @return GridFS file handle instance.
*/
public GridFSInputFile createFile() {
return new GridFSInputFile( this );
}



Expand Down
Loading