Class AbstractFilesystemAction
java.lang.Object
com.kingsrook.qqq.backend.module.filesystem.base.actions.AbstractBaseFilesystemAction<File>
com.kingsrook.qqq.backend.module.filesystem.local.actions.AbstractFilesystemAction
- Direct Known Subclasses:
FilesystemCountAction
,FilesystemDeleteAction
,FilesystemInsertAction
,FilesystemQueryAction
,FilesystemStorageAction
Base class for all (local) Filesystem actions
-
Field Summary
Fields inherited from class com.kingsrook.qqq.backend.module.filesystem.base.actions.AbstractBaseFilesystemAction
backendVariantRecord
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteFile
(QTableMetaData table, String fileReference) In contrast with the DeleteAction, which deletes RECORDS - this is a filesystem-(or s3, sftp, etc)-specific extension to delete an entire FILE e.g., for post-ETL.getFileCreateDate
(File file) get the createDate of the specified file, null if not supported/availablegetFileModifyDate
(File file) get the createDate of the specified file, null if not supported/availablegetFileSize
(File file) get the size of the specified file, null if not supported/availablegetFullPathForFile
(File file) Get a string that represents the full path to a file.listFiles
(QTableMetaData table, QBackendMetaData backendBase, String requestedPath) List the files for this table.void
moveFile
(QInstance instance, QTableMetaData table, String source, String destination) Move a file from a source path, to a destination path.Read the contents of a file.stripBackendAndTableBasePathsFromFileName
(String filePath, QBackendMetaData backend, QTableMetaData table) e.g., with a base path of /foo/ and a table path of /bar/ and a file at /foo/bar/baz.txt give us just the baz.txt part.void
writeFile
(QBackendMetaData backend, QTableMetaData table, QRecord record, String path, byte[] contents) Write a file - to be implemented in module-specific subclasses.Methods inherited from class com.kingsrook.qqq.backend.module.filesystem.base.actions.AbstractBaseFilesystemAction
addBackendDetailsToRecord, addBackendDetailsToRecords, executeCount, executeDelete, executeInsert, executeQuery, getBackendMetaData, getFullBasePath, getTableBackendDetails, isPathEqualsCriteria, listFiles, postAction, preAction, stripDuplicatedSlashes, stripLeadingSlash, stripTrailingSlash, writeFile
-
Constructor Details
-
AbstractFilesystemAction
public AbstractFilesystemAction()
-
-
Method Details
-
getFileSize
Description copied from class:AbstractBaseFilesystemAction
get the size of the specified file, null if not supported/available- Specified by:
getFileSize
in classAbstractBaseFilesystemAction<File>
-
getFileCreateDate
Description copied from class:AbstractBaseFilesystemAction
get the createDate of the specified file, null if not supported/available- Specified by:
getFileCreateDate
in classAbstractBaseFilesystemAction<File>
-
getFileModifyDate
Description copied from class:AbstractBaseFilesystemAction
get the createDate of the specified file, null if not supported/available- Specified by:
getFileModifyDate
in classAbstractBaseFilesystemAction<File>
-
listFiles
public List<File> listFiles(QTableMetaData table, QBackendMetaData backendBase, String requestedPath) throws QException List the files for this table.- Specified by:
listFiles
in classAbstractBaseFilesystemAction<File>
- Throws:
QException
-
readFile
Read the contents of a file.- Specified by:
readFile
in classAbstractBaseFilesystemAction<File>
- Throws:
IOException
-
writeFile
public void writeFile(QBackendMetaData backend, QTableMetaData table, QRecord record, String path, byte[] contents) throws IOException Write a file - to be implemented in module-specific subclasses.- Specified by:
writeFile
in classAbstractBaseFilesystemAction<File>
- Throws:
IOException
-
getFullPathForFile
Get a string that represents the full path to a file.- Specified by:
getFullPathForFile
in classAbstractBaseFilesystemAction<File>
-
deleteFile
In contrast with the DeleteAction, which deletes RECORDS - this is a filesystem-(or s3, sftp, etc)-specific extension to delete an entire FILE e.g., for post-ETL.- Specified by:
deleteFile
in classAbstractBaseFilesystemAction<File>
- Throws:
FilesystemException
- if the delete is known to have failed, and the file is thought to still exit
-
moveFile
public void moveFile(QInstance instance, QTableMetaData table, String source, String destination) throws FilesystemException Move a file from a source path, to a destination path.- Specified by:
moveFile
in classAbstractBaseFilesystemAction<File>
- Parameters:
destination
- assumed to be a file path - not a directory- Throws:
FilesystemException
- if the delete is known to have failed
-
stripBackendAndTableBasePathsFromFileName
public String stripBackendAndTableBasePathsFromFileName(String filePath, QBackendMetaData backend, QTableMetaData table) e.g., with a base path of /foo/ and a table path of /bar/ and a file at /foo/bar/baz.txt give us just the baz.txt part.- Overrides:
stripBackendAndTableBasePathsFromFileName
in classAbstractBaseFilesystemAction<File>
-