UploadBuilder
CLASS in nl.bimbase.bimworks.client.upload.
API catalogue · nl.bimbase.bimworks.client.upload · CLASS
public class UploadBuilderA convenient builder to construct the arguments for uploading a model
Members#
| Member | Kind | Description |
|---|---|---|
| UploadBuilder(UUID) | CONSTRUCTOR | Create a new UploadBuilder |
| fromPath(Path) | METHOD | Instruct the UploadBuilder to read the actual data from the given Path |
| fromFile(File) | METHOD | Instruct the UploadBuilder to read the actual data from the given File |
| fromInputStream(InputStream, long) | METHOD | Instruct the UploadBuilder to read the actual data from the given InputStream. The client will always read and send the full stream, regardless of the provid… |
| fromInputStreamNoCheck(InputStream, long) | METHOD | Instruct the UploadBuilder to read the actual data from the given InputStream. The client will always read and send the full stream, regardless of the provid… |
| fromInputStream(InputStream) | METHOD | Instruct the UploadBuilder to read the actual data from the given InputStream. |
| fromBytes(byte[]) | METHOD | Instruct the UploadBuilder to read the actual data from the given byte[]. NoteKeep in mind that sending around large byte[] could cause heap size issues, if … |
| url(URL) | METHOD | Instruct the UploadBuilder to read the actual data from the given URL. This method streams the data through the client to the BIM.works Repository. Use urlPa… |
| urlPassThrough(URL, long) | METHOD | Instruct the UploadBuilder to pass the given URL to the BIM.works Repository and to start processing it. This method will send the URL itself to the BIM.work… |
| from(ByteSource) | METHOD | Instruct the UploadBuilder to read the actual data from the given ByteSource (From the Google Guava library) |
| getNodeUuid() | METHOD | |
| getPath() | METHOD | |
| getFilename() | METHOD | |
| determineFilename() | METHOD | Determines the filename from the data given so far, generally not required to call this manually. |
| determineFilesize() | METHOD | Determines the filesize from the given data so far, generally not required to call this manually |
| option(UploadOption) | METHOD | Provide additional upload options. |
| getUploadOption() | METHOD | |
| getUrl() | METHOD | |
| getTimeOutUnit() | METHOD | |
| getTimeOutValue() | METHOD | |
| timeOut(long, TimeUnit) | METHOD | |
| getInputStream() | METHOD | |
| getContentType() | METHOD | |
| setContentType(String) | METHOD | Manually set the Content-Type |
| filename(String) | METHOD | Sets the filename. Note This is not a method to provide the data, it only set's the name of the file for meta-data purposes |
| forceReprocessing(boolean) | METHOD | |
| isForceReprocessing() | METHOD | |
| getByteSource() | METHOD | |
| progressListener(ProgressListener) | METHOD | Attach a progress listener, for feedback on the progress of the upload once it has started. Only one progress listener can be set, calling this method twice … |
| getProgressListener() | METHOD | |
| suppressDebugMessages(boolean) | METHOD | Instruct BIM.works Repository to suppress any debug messages. Currently does not do anything |
| isSuppressDebugMessages() | METHOD | |
| validationLevel(ValidationLevel) | METHOD | Set the validation level. This allows you to instruct BIM.works on how strict the model should be validated. This is only IFC-level validation, for model che… |
| getValidationLevel() | METHOD | |
| getUrlPassThrough() | METHOD | |
| filesize(long) | METHOD | Set the filesize manually. Generally this is not required and will be done automatically, but for example for urlPassThrough uploads this is required. |
| explicitCompression(CompressionType) | METHOD | |
| getExplicitCompressionType() | METHOD | |
| tag(VersionTag) | METHOD | |
| getTags() | METHOD |
UploadBuilder(UUID)#
public UploadBuilder(java.util.UUID nodeUuid)Create a new UploadBuilder
Parameters#
| Name | Type | Description |
|---|---|---|
nodeUuid |
java.util.UUID |
The UUID of the Node that you intend to upload to |
fromPath(Path)#
public nl.bimbase.bimworks.client.upload.UploadBuilder fromPath(java.nio.file.Path path) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to read the actual data from the given Path
Parameters#
| Name | Type | Description |
|---|---|---|
path |
java.nio.file.Path |
The Path on which to find the data to upload |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
fromFile(File)#
public nl.bimbase.bimworks.client.upload.UploadBuilder fromFile(java.io.File file) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to read the actual data from the given File
Parameters#
| Name | Type | Description |
|---|---|---|
file |
java.io.File |
The File in which to find the data to upload |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
fromInputStream(InputStream, long)#
public nl.bimbase.bimworks.client.upload.UploadBuilder fromInputStream(java.io.InputStream inputStream, long filesize) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to read the actual data from the given InputStream. The client will always read and send the full stream, regardless of the provided filesize.
Parameters#
| Name | Type | Description |
|---|---|---|
inputStream |
java.io.InputStream |
The stream to take the data from, called stays responsible for closing the InputStream. |
filesize |
long |
The size in bytes of the data that is provided. |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
fromInputStreamNoCheck(InputStream, long)#
public nl.bimbase.bimworks.client.upload.UploadBuilder fromInputStreamNoCheck(java.io.InputStream inputStream, long filesize) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to read the actual data from the given InputStream. The client will always read and send the full stream, regardless of the provided filesize.
This implementation does not check for previous data set on the UploadBuilder and will overwrite it.
Parameters#
| Name | Type | Description |
|---|---|---|
inputStream |
java.io.InputStream |
The stream to take the data from, called stays responsible for closing the InputStream. |
filesize |
long |
The size in bytes of the data that is provided. |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
fromInputStream(InputStream)#
public nl.bimbase.bimworks.client.upload.UploadBuilder fromInputStream(java.io.InputStream inputStream) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to read the actual data from the given InputStream.
Parameters#
| Name | Type | Description |
|---|---|---|
inputStream |
java.io.InputStream |
The stream to take the data from, called stays responsible for closing the InputStream. |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
fromBytes(byte[])#
public nl.bimbase.bimworks.client.upload.UploadBuilder fromBytes(byte[] bytes) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to read the actual data from the given byte[]. NoteKeep in mind that sending around large byte[] could cause heap size issues, if possible prefer reading from fromFile, fromPath or fromInputStream
Parameters#
| Name | Type | Description |
|---|---|---|
bytes |
byte[] |
The data as a byte[] |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
url(URL)#
public nl.bimbase.bimworks.client.upload.UploadBuilder url(java.net.URL url) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to read the actual data from the given URL.
This method streams the data through the client to the BIM.works Repository. Use urlPassThrough to actually send the URL to BIM.works Repository and let the repository download the data. This can be a more efficient way to pass large models to the BIM.works repository (for example from S3, Azure Blob Storage etc...).
It does not first download the whole file into a temporary file. The normal hash-probe path can still stage a one-shot stream when a partial hash matched and a full-hash check is needed.
Parameters#
| Name | Type | Description |
|---|---|---|
url |
java.net.URL |
A URL to the location of the data |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
urlPassThrough(URL, long)#
public nl.bimbase.bimworks.client.upload.UploadBuilder urlPassThrough(java.net.URL url, long filesize) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to pass the given URL to the BIM.works Repository and to start processing it.
This method will send the URL itself to the BIM.works Repository (pass through). This can be useful when your data is not stored on your application server (or client) but for example on AWS S3, Azure Blob Storage or a similar storage solution. When using this method make sure that:
- The host in the URL can be resolved (DNS) from the BIM.works Repository location
- The host in the URL can be reached (routed) from the BIM.works Repository location
- The URL includes the proper authentication. On AWS S3 you can use pre-signed URLs, on Azure Blob Storage you can use Shared Access Signatures (SAS)
- You provide a filename, often this cannot be inferred from the URL.
This method is agnostic of any storage provider, although examples are given for S3 and Azure Blob Storage.
Parameters#
| Name | Type | Description |
|---|---|---|
url |
java.net.URL |
A URL to the location of the data |
filesize |
long |
Since it is not guaranteed that the data-sending server will include a Content-Length, and for verification purposes, the size of the file must always be specified when using this method |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
from(ByteSource)#
public nl.bimbase.bimworks.client.upload.UploadBuilder from(com.google.common.io.ByteSource byteSource) throws nl.bimbase.bimworks.client.upload.UploadBuilderExceptionInstruct the UploadBuilder to read the actual data from the given ByteSource (From the Google Guava library)
Parameters#
| Name | Type | Description |
|---|---|---|
byteSource |
com.google.common.io.ByteSource |
The ByteSource to read the data from |
Returns#
Returns the UploadBuilder (this)
Exceptions#
UploadBuilderException— Will be thrown when a data source had already been provided
getNodeUuid()#
public java.util.UUID getNodeUuid()Returns#
The UUID of the Node the data will be uploaded to
getPath()#
public java.nio.file.Path getPath()Returns#
The currently set Path
getFilename()#
public java.lang.String getFilename()Returns#
The currently set filename
determineFilename()#
public java.lang.String determineFilename()Determines the filename from the data given so far, generally not required to call this manually.
Returns#
The determined filename
determineFilesize()#
public long determineFilesize() throws java.io.IOExceptionDetermines the filesize from the given data so far, generally not required to call this manually
Returns#
The determined filesize
Exceptions#
IOException—
option(UploadOption)#
public nl.bimbase.bimworks.client.upload.UploadBuilder option(nl.bimbase.bimworks.client.UploadOption uploadOption)Deprecated: This will be removed in the future
Provide additional upload options.
Parameters#
| Name | Type | Description |
|---|---|---|
uploadOption |
UploadOption |
getUploadOption()#
public nl.bimbase.bimworks.client.UploadOption getUploadOption()getUrl()#
public java.net.URL getUrl()getTimeOutUnit()#
public java.util.concurrent.TimeUnit getTimeOutUnit()getTimeOutValue()#
public long getTimeOutValue()timeOut(long, TimeUnit)#
public nl.bimbase.bimworks.client.upload.UploadBuilder timeOut(long timeOutValue, java.util.concurrent.TimeUnit timeOutUnit)Parameters#
| Name | Type | Description |
|---|---|---|
timeOutValue |
long |
|
timeOutUnit |
java.util.concurrent.TimeUnit |
getInputStream()#
public java.io.InputStream getInputStream()Returns#
The currently configured InputStream
getContentType()#
public java.lang.String getContentType()Returns#
The currently configured Content-Type
setContentType(String)#
public void setContentType(java.lang.String contentType)Manually set the Content-Type
Parameters#
| Name | Type | Description |
|---|---|---|
contentType |
java.lang.String |
The Content-Type, should be in the same format as HTTP Header Content-Type |
filename(String)#
public nl.bimbase.bimworks.client.upload.UploadBuilder filename(java.lang.String filename)Sets the filename. Note This is not a method to provide the data, it only set's the name of the file for meta-data purposes
Parameters#
| Name | Type | Description |
|---|---|---|
filename |
java.lang.String |
The filename of the model |
Returns#
UploadBuilder (this)
forceReprocessing(boolean)#
public nl.bimbase.bimworks.client.upload.UploadBuilder forceReprocessing(boolean forceReprocessing)Parameters#
| Name | Type | Description |
|---|---|---|
forceReprocessing |
boolean |
isForceReprocessing()#
public boolean isForceReprocessing()getByteSource()#
public com.google.common.io.ByteSource getByteSource()Returns#
The currently set ByteSource
progressListener(ProgressListener)#
public nl.bimbase.bimworks.client.upload.UploadBuilder progressListener(nl.sascom.backplane.common.ProgressListener progressListener)Attach a progress listener, for feedback on the progress of the upload once it has started. Only one progress listener can be set, calling this method twice will overwrite the previous listener
Parameters#
| Name | Type | Description |
|---|---|---|
progressListener |
nl.sascom.backplane.common.ProgressListener |
The listener that should be called |
Returns#
UploadBuilder (this)
getProgressListener()#
public nl.sascom.backplane.common.ProgressListener getProgressListener()Returns#
The currently attached progress listener or null
suppressDebugMessages(boolean)#
public nl.bimbase.bimworks.client.upload.UploadBuilder suppressDebugMessages(boolean suppressDebugMessages)Instruct BIM.works Repository to suppress any debug messages.
Currently does not do anything
Parameters#
| Name | Type | Description |
|---|---|---|
suppressDebugMessages |
boolean |
isSuppressDebugMessages()#
public boolean isSuppressDebugMessages()Returns#
Whether debug messages are currently suppressed
validationLevel(ValidationLevel)#
public nl.bimbase.bimworks.client.upload.UploadBuilder validationLevel(nl.bimbase.bimworks.api.render.ValidationLevel validationLevel)Set the validation level. This allows you to instruct BIM.works on how strict the model should be validated. This is only IFC-level validation, for model checking please refer to ModelChecksApi
The default validation level is nl.bimbase.bimworks.api.render.ValidationLevel#DEFAULT
Parameters#
| Name | Type | Description |
|---|---|---|
validationLevel |
nl.bimbase.bimworks.api.render.ValidationLevel |
The validation level to use |
Returns#
UploadBuilder (this)
getValidationLevel()#
public nl.bimbase.bimworks.api.render.ValidationLevel getValidationLevel()Returns#
The currently set validation level
getUrlPassThrough()#
public java.net.URL getUrlPassThrough()Returns#
Any currently set passthrough URL
filesize(long)#
public nl.bimbase.bimworks.client.upload.UploadBuilder filesize(long filesize)Set the filesize manually. Generally this is not required and will be done automatically, but for example for urlPassThrough uploads this is required.
Parameters#
| Name | Type | Description |
|---|---|---|
filesize |
long |
The size of the file in bytes |
Returns#
UploadBuilder (this)
explicitCompression(CompressionType)#
public nl.bimbase.bimworks.client.upload.UploadBuilder explicitCompression(nl.sascom.backplane.common.CompressionType explicitCompressionType)Parameters#
| Name | Type | Description |
|---|---|---|
explicitCompressionType |
nl.sascom.backplane.common.CompressionType |
getExplicitCompressionType()#
public nl.sascom.backplane.common.CompressionType getExplicitCompressionType()tag(VersionTag)#
public nl.bimbase.bimworks.client.upload.UploadBuilder tag(nl.bimbase.bimworks.client.upload.VersionTag tag)Parameters#
| Name | Type | Description |
|---|---|---|
tag |
VersionTag |
getTags()#
public java.util.Set<nl.bimbase.bimworks.client.upload.VersionTag> getTags()Inherited members#
java.lang.Object#equals(java.lang.Object)java.lang.Object#toString()java.lang.Object#wait(long)java.lang.Object#wait(long,int)java.lang.Object#wait()java.lang.Object#finalize()java.lang.Object#getClass()java.lang.Object#hashCode()java.lang.Object#clone()java.lang.Object#notify()java.lang.Object#notifyAll()