public interface ContentProvider
Modifier and Type | Method and Description |
---|---|
boolean |
createFolder(String folderPath,
com.qoppa.spi.Session session)
Create a new folder a the specified path.
|
boolean |
deleteFile(String path,
com.qoppa.spi.Session session)
Deletes the file at the specified path.
|
boolean |
deleteFolder(String folderPath,
boolean recursive,
com.qoppa.spi.Session session)
Deletes the folder at the specified path.
|
boolean |
exists(String path,
com.qoppa.spi.Session session)
Returns true if a file or folder exists at the specified path.
|
List<String> |
getChildren(String folderPath,
com.qoppa.spi.Session session)
Gets a list of the names of the files and directories in the specified folder.
|
long |
getFileSize(String path,
com.qoppa.spi.Session session)
Gets the size in bytes of file at the specified path.
|
InputStream |
getInputStream(String path,
com.qoppa.spi.Session session)
Gets the input stream of the file at the specified path.
|
String |
getProviderName()
Gets the human readable name of the provider.
|
void |
upload(InputStream in,
long length,
String path,
com.qoppa.spi.Session session)
Uploads the file to the specified path.
|
boolean |
validateConfiguration()
Validates the provider configuration.
|
String getProviderName()
boolean createFolder(String folderPath, com.qoppa.spi.Session session)
folderPath
- The path to the new folder. It is relative to the base directory.session
- The existing Session object.boolean exists(String path, com.qoppa.spi.Session session)
path
- The path to the file or folder relative to the base directory.session
- The existing Session object.long getFileSize(String path, com.qoppa.spi.Session session)
path
- The path of the file relative to the base directory.session
- The existing Session object.InputStream getInputStream(String path, com.qoppa.spi.Session session) throws IOException
path
- The path of the file relative to the base directory.session
- The existing Session object.IOException
void upload(InputStream in, long length, String path, com.qoppa.spi.Session session) throws IOException
in
- The file's input stream.length
- The length of the input stream. May be -1 if unknown.path
- The path of the file relative to the base directory.session
- The existing Session object.IOException
boolean deleteFile(String path, com.qoppa.spi.Session session)
path
- The path of the file relative to the base directory.session
- The existing Session object.boolean deleteFolder(String folderPath, boolean recursive, com.qoppa.spi.Session session)
folderPath
- The path of the folder relative to the base directory.recursive
- Set to true if all sub-folders should be deleted.session
- The existing Session object.List<String> getChildren(String folderPath, com.qoppa.spi.Session session)
folderPath
- The path of the folder relative to the base directory.session
- The existing Session object.boolean validateConfiguration()