Class PutTask
java.lang.Object
org.eclipse.aether.spi.connector.transport.TransportTask
org.eclipse.aether.spi.connector.transport.PutTask
A task to upload a resource to the remote repository.
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated.longGets the total number of bytes to be uploaded.Gets the file (if any) with the data to be uploaded.Opens an input stream for the data to be uploaded.setDataBytes(byte[] bytes) Sets the binary data to be uploaded.setDataFile(File dataFile) Deprecated.UsesetDataPath(Path)instead.setDataPath(Path dataPath) Sets the file with the data to be uploaded.setDataString(String str) Sets the textual data to be uploaded.setListener(TransportListener listener) Sets the listener that is to be notified during the transfer.toString()Methods inherited from class org.eclipse.aether.spi.connector.transport.TransportTaskgetListener, getLocation
- 
Constructor Details- 
PutTaskCreates a new task for the specified remote resource.- Parameters:
- location- The relative location of the resource in the remote repository, must not be- null.
 
 
- 
- 
Method Details- 
newInputStreamOpens an input stream for the data to be uploaded. The length of the stream can be queried viagetDataLength(). It's the responsibility of the caller to close the provided stream.- Returns:
- The input stream for the data, never null. The stream is unbuffered.
- Throws:
- IOException- If the stream could not be opened.
 
- 
getDataLengthGets the total number of bytes to be uploaded.- Returns:
- The total number of bytes to be uploaded.
 
- 
getDataFileDeprecated.UsegetDataPath()instead.Gets the file (if any) with the data to be uploaded.- Returns:
- The data file or nullif the data resides in memory.
 
- 
getDataPathGets the file (if any) with the data to be uploaded.- Returns:
- The data file or nullif the data resides in memory.
- Since:
- 2.0.0
 
- 
setDataFileDeprecated.UsesetDataPath(Path)instead.Sets the file with the data to be uploaded. To upload some data residing already in memory, usesetDataString(String)orsetDataBytes(byte[]).- Parameters:
- dataFile- The data file, may be- nullif the resource data is provided directly from memory.
- Returns:
- This task for chaining, never null.
 
- 
setDataPathSets the file with the data to be uploaded. To upload some data residing already in memory, usesetDataString(String)orsetDataBytes(byte[]).- Parameters:
- dataPath- The data file, may be- nullif the resource data is provided directly from memory.
- Returns:
- This task for chaining, never null.
- Since:
- 2.0.0
 
- 
setDataBytesSets the binary data to be uploaded.- Parameters:
- bytes- The binary data, may be- null.
- Returns:
- This task for chaining, never null.
 
- 
setDataStringSets the textual data to be uploaded. The text is encoded using UTF-8 before transmission.- Parameters:
- str- The textual data, may be- null.
- Returns:
- This task for chaining, never null.
 
- 
setListenerSets the listener that is to be notified during the transfer.- Parameters:
- listener- The listener to notify of progress, may be- null.
- Returns:
- This task for chaining, never null.
 
- 
toString
 
- 
getDataPath()instead.