Package com.dnanexus
Class DXFile.Builder
- java.lang.Object
-
- com.dnanexus.DXDataObject.Builder<DXFile.Builder,DXFile>
-
- com.dnanexus.DXFile.Builder
-
- Enclosing class:
- DXFile
public static class DXFile.Builder extends DXDataObject.Builder<DXFile.Builder,DXFile>
Builder class for creating a newDXFileobject. To obtain an instance, callDXFile.newFile().
-
-
Field Summary
-
Fields inherited from class com.dnanexus.DXDataObject.Builder
createParents, details, env, folder, hidden, name, project, properties, tags, types
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DXFilebuild()Creates the file.protected DXFile.BuildergetThisInstance()Returns the builder object.DXFile.BuildersetMediaType(String mediaType)Sets the Internet Media Type of the file to be created.DXFile.Builderupload(byte[] data)Uploads the data in the specified byte array to the file to be created.DXFile.Builderupload(InputStream data)Uploads the data in the specified stream to the file to be created.-
Methods inherited from class com.dnanexus.DXDataObject.Builder
addTags, addTypes, checkAndFixParameters, getNewObjectId, putAllProperties, putProperty, setDetails, setFolder, setFolder, setName, setProject, setVisibility
-
-
-
-
Method Detail
-
build
public DXFile build()
Creates the file.- Specified by:
buildin classDXDataObject.Builder<DXFile.Builder,DXFile>- Returns:
- a
DXFileobject corresponding to the newly created object
-
getThisInstance
protected DXFile.Builder getThisInstance()
Description copied from class:DXDataObject.BuilderReturns the builder object.This abstract method is implemented by the Builder methods so that common methods can get an instance of the subclass for chaining purposes.
- Specified by:
getThisInstancein classDXDataObject.Builder<DXFile.Builder,DXFile>- Returns:
- the same object
-
setMediaType
public DXFile.Builder setMediaType(String mediaType)
Sets the Internet Media Type of the file to be created.- Parameters:
mediaType- Internet Media Type- Returns:
- the same
Builderobject
-
upload
public DXFile.Builder upload(byte[] data)
Uploads the data in the specified byte array to the file to be created.- Parameters:
data- data to be uploaded- Returns:
- the same
Builderobject
-
upload
public DXFile.Builder upload(InputStream data)
Uploads the data in the specified stream to the file to be created.- Parameters:
data- stream containing data to be uploaded- Returns:
- the same
Builderobject
-
-