Package com.dtolabs.rundeck.plugins.file
Interface FileUploadPlugin
-
public interface FileUploadPluginPlugin interface for handling uploaded files for job execution.- Since:
- 2/15/17
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classFileUploadPlugin.ExternalStateRepresents file states known to rundeckstatic classFileUploadPlugin.InternalStateRepresents file states known to the plugin
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanhasFile(java.lang.String ref)Return true if the file can be retrieved viaretrieveFile(String, OutputStream)orretrieveFile(String)voidinitialize()Initializes the plugin before usebooleanremoveFile(java.lang.String reference)Remove the filejava.io.InputStreamretrieveFile(java.lang.String ref)Retrieve the file by referencevoidretrieveFile(java.lang.String ref, java.io.OutputStream out)Retrieve the file by referencejava.io.FileretrieveLocalFile(java.lang.String ref)Retrieve the file if it is available locally, otherwise return nullFileUploadPlugin.InternalStatetransitionState(java.lang.String reference, FileUploadPlugin.ExternalState state)Transition between states, allows plugin to determine behaviorjava.lang.StringuploadFile(java.io.InputStream content, long length, java.lang.String refid, java.util.Map<java.lang.String,java.lang.String> config)Upload a file for the given job and file input name, and return an identifier to reference the uploaded file.
-
-
-
Method Detail
-
initialize
void initialize()
Initializes the plugin before use
-
uploadFile
java.lang.String uploadFile(java.io.InputStream content, long length, java.lang.String refid, java.util.Map<java.lang.String,java.lang.String> config) throws java.io.IOExceptionUpload a file for the given job and file input name, and return an identifier to reference the uploaded file.- Parameters:
content- contentlength- data lengthrefid- unique identifier for the file- Returns:
- identifier
- Throws:
java.io.IOException
-
retrieveFile
void retrieveFile(java.lang.String ref, java.io.OutputStream out) throws java.io.IOExceptionRetrieve the file by reference- Parameters:
ref- refout- outputstream to write it to- Throws:
java.io.IOException
-
hasFile
boolean hasFile(java.lang.String ref)
Return true if the file can be retrieved viaretrieveFile(String, OutputStream)orretrieveFile(String)- Parameters:
ref- ref- Returns:
- true if the file can be retrieved, false if the retrieve call will fail
-
retrieveLocalFile
java.io.File retrieveLocalFile(java.lang.String ref) throws java.io.IOExceptionRetrieve the file if it is available locally, otherwise return null- Parameters:
ref- ref- Returns:
- local file, or null if not directly available
- Throws:
java.io.IOException
-
retrieveFile
java.io.InputStream retrieveFile(java.lang.String ref)
Retrieve the file by reference- Parameters:
ref- ref- Returns:
- inputstream to read the file
-
removeFile
boolean removeFile(java.lang.String reference)
Remove the file- Parameters:
reference-- Returns:
-
transitionState
FileUploadPlugin.InternalState transitionState(java.lang.String reference, FileUploadPlugin.ExternalState state)
Transition between states, allows plugin to determine behavior- Parameters:
reference- referencestate- the new external state of the file- Returns:
- the new internal state of the file
-
-