Package com.dtolabs.rundeck.plugins.file
Interface FileUploadPlugin
-
public interface FileUploadPlugin
Plugin interface for handling uploaded files for job execution.- Since:
- 2/15/17
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
FileUploadPlugin.ExternalState
Represents file states known to rundeckstatic class
FileUploadPlugin.InternalState
Represents file states known to the plugin
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasFile(java.lang.String ref)
Return true if the file can be retrieved viaretrieveFile(String, OutputStream)
orretrieveFile(String)
void
initialize()
Initializes the plugin before useboolean
removeFile(java.lang.String reference)
Remove the filejava.io.InputStream
retrieveFile(java.lang.String ref)
Retrieve the file by referencevoid
retrieveFile(java.lang.String ref, java.io.OutputStream out)
Retrieve the file by referencejava.io.File
retrieveLocalFile(java.lang.String ref)
Retrieve the file if it is available locally, otherwise return nullFileUploadPlugin.InternalState
transitionState(java.lang.String reference, FileUploadPlugin.ExternalState state)
Transition between states, allows plugin to determine behaviorjava.lang.String
uploadFile(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.IOException
Upload 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.IOException
Retrieve 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.IOException
Retrieve 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
-
-