Interface TemplateStorage
-
- All Superinterfaces:
java.lang.AutoCloseable,de.dytanic.cloudnet.common.INameable
- All Known Implementing Classes:
DefaultAsyncTemplateStorage,DefaultSyncTemplateStorage,RemoteTemplateStorage
public interface TemplateStorage extends java.lang.AutoCloseable, de.dytanic.cloudnet.common.INameable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @Nullable java.io.OutputStreamappendOutputStream(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a newOutputStreamthat will append its content to the file at the given path.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.OutputStream>appendOutputStreamAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a newOutputStreamthat will append its content to the file at the given path.default @Nullable java.util.zip.ZipInputStreamasZipInputStream(@NotNull ServiceTemplate template)Gets a template into aZipInputStream.default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.zip.ZipInputStream>asZipInputStreamAsync(@NotNull ServiceTemplate template)Gets a template into aZipInputStream.voidclose()Closes this storage, after it has been closed, no more interaction to this storage should be done and might lead to errors.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>closeAsync()Closes this storage, after it has been closed, no more interaction to this storage should be done and might lead to errors.booleancopy(@NotNull ServiceTemplate template, @NotNull java.nio.file.Path directory)Copies the given template into the given directory@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>copyAsync(@NotNull ServiceTemplate template, @NotNull java.nio.file.Path directory)Copies the given template into the given directorybooleancreate(@NotNull ServiceTemplate template)Creates the given template if it doesn't exists.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>createAsync(@NotNull ServiceTemplate template)Creates the given template if it doesn't exists.booleancreateDirectory(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a new directory in the given template at the given path if it doesn't exist.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>createDirectoryAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a new directory in the given template at the given path if it doesn't exist.booleancreateFile(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a new file in the given template at the given path if it doesn't exist.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>createFileAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a new file in the given template at the given path if it doesn't exist.booleandelete(@NotNull ServiceTemplate template)Deletes the given template if it exists.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deleteAsync(@NotNull ServiceTemplate template)Deletes the given template if it exists.booleandeleteFile(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Deletes a file in the given template at the given path if it doesn't exist.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deleteFileAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Deletes a file in the given template at the given path if it doesn't exist.booleandeploy(@NotNull java.io.InputStream inputStream, @NotNull ServiceTemplate target)Copies the given stream into the given template.default booleandeploy(@NotNull java.nio.file.Path directory, @NotNull ServiceTemplate target)Copies the given directory into the given template.booleandeploy(@NotNull java.nio.file.Path directory, @NotNull ServiceTemplate target, @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)Deploys the following directory files to the target template storage.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deployAsync(@NotNull java.io.InputStream inputStream, @NotNull ServiceTemplate target)Copies the given directory into the given template.default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deployAsync(@NotNull java.nio.file.Path directory, @NotNull ServiceTemplate target)Copies the given directory into the given template.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deployAsync(@NotNull java.nio.file.Path directory, @NotNull ServiceTemplate target, @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)Deploys the following directory files to the target template storage.@Nullable FileInfogetFileInfo(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Retrieves information about a specified file/directory.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo>getFileInfoAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Retrieves information about a specified file/directory.@NotNull java.util.Collection<ServiceTemplate>getTemplates()Gets a list of all templates that exist in this storage.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTemplate>>getTemplatesAsync()Gets a list of all templates that exist in this storage.booleanhas(@NotNull ServiceTemplate template)Checks whether the given template exists.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>hasAsync(@NotNull ServiceTemplate template)Checks whether the given template exists.booleanhasFile(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Checks whether the given path/directory exists in the given template, it doesn't matter if it is a directory or a file.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>hasFileAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Checks whether the given path/directory exists in the given template, it doesn't matter if it is a directory or a file.default @Nullable FileInfo[]listFiles(@NotNull ServiceTemplate template)Lists all files in the root directory of the template (including sub directories).default @Nullable FileInfo[]listFiles(@NotNull ServiceTemplate template, boolean deep)Lists all files in the root directory of the template.default @Nullable FileInfo[]listFiles(@NotNull ServiceTemplate template, @NotNull java.lang.String dir)Lists all files in the given directory (including sub directories).@Nullable FileInfo[]listFiles(@NotNull ServiceTemplate template, @NotNull java.lang.String dir, boolean deep)Lists all files in the given directory.default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]>listFilesAsync(@NotNull ServiceTemplate template)Lists all files in the root directory of the template (including sub directories).default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]>listFilesAsync(@NotNull ServiceTemplate template, boolean deep)Lists all files in the root directory of the template.default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]>listFilesAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String dir)Lists all files in the given directory (including sub directories).@NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]>listFilesAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String dir, boolean deep)Lists all files in the given directory.@Nullable java.io.InputStreamnewInputStream(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a newInputStreamwith the data of the file at the given path in the given template.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.InputStream>newInputStreamAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a newInputStreamwith the data of the file at the given path in the given template.@Nullable java.io.OutputStreamnewOutputStream(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a newOutputStreamthat will override its content to the file at the given path.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.OutputStream>newOutputStreamAsync(@NotNull ServiceTemplate template, @NotNull java.lang.String path)Creates a newOutputStreamthat will override its content to the file at the given path.@Nullable java.io.InputStreamzipTemplate(@NotNull ServiceTemplate template)Zips a template into anInputStream.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.InputStream>zipTemplateAsync(@NotNull ServiceTemplate template)Zips a template into anInputStream.
-
-
-
Method Detail
-
deploy
boolean deploy(@NotNull @NotNull java.nio.file.Path directory, @NotNull @NotNull ServiceTemplate target, @Nullable @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)Deploys the following directory files to the target template storage. If the given file filter is not null, method will apply every single file to the given file filter and only deploy files that were allowed by the filter.- Parameters:
directory- the directory to be deployedtarget- the template to be deployed tofileFilter- the filter for files that should be deployed- Returns:
- whether it was copied successfully
-
deploy
default boolean deploy(@NotNull @NotNull java.nio.file.Path directory, @NotNull @NotNull ServiceTemplate target)Copies the given directory into the given template.- Parameters:
directory- the directory to be deployedtarget- the template to be deployed to- Returns:
- whether it was copied successfully
-
deploy
boolean deploy(@NotNull @NotNull java.io.InputStream inputStream, @NotNull @NotNull ServiceTemplate target)Copies the given stream into the given template.- Parameters:
inputStream- the zipped data to be deployedtarget- the template to be deployed to- Returns:
- whether it was copied successfully
-
copy
boolean copy(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.nio.file.Path directory)Copies the given template into the given directory- Parameters:
template- the template to copy the files fromdirectory- the target directory to copy the files to- Returns:
- whether it was copied successfully
-
asZipInputStream
@Nullable default @Nullable java.util.zip.ZipInputStream asZipInputStream(@NotNull @NotNull ServiceTemplate template) throws java.io.IOExceptionGets a template into aZipInputStream.- Parameters:
template- the template to be zipped- Returns:
- a new
ZipInputStreamor null if it the template doesn't exist - Throws:
java.io.IOException- if an I/O error occurred
-
zipTemplate
@Nullable @Nullable java.io.InputStream zipTemplate(@NotNull @NotNull ServiceTemplate template) throws java.io.IOExceptionZips a template into anInputStream.- Parameters:
template- the template to be zipped- Returns:
- a new
InputStreamor null if it the template doesn't exist - Throws:
java.io.IOException- if an I/O error occurred
-
delete
boolean delete(@NotNull @NotNull ServiceTemplate template)Deletes the given template if it exists.- Parameters:
template- the template to be deleted- Returns:
- whether the template was successfully deleted,
falseif it doesn't exists
-
create
boolean create(@NotNull @NotNull ServiceTemplate template)Creates the given template if it doesn't exists.- Parameters:
template- the template to be deleted- Returns:
- whether the template was successfully created,
falseif it already exists
-
has
boolean has(@NotNull @NotNull ServiceTemplate template)Checks whether the given template exists.- Parameters:
template- the template to be checked- Returns:
- whether the template exists or not
-
appendOutputStream
@Nullable @Nullable java.io.OutputStream appendOutputStream(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOExceptionCreates a newOutputStreamthat will append its content to the file at the given path. If the file at the given path doesn't exist, it will be created. To finish your modifications, you'll need to close theOutputStream.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- a new
OutputStreamornullif it couldn't be opened - Throws:
java.io.IOException- if an I/O error occurred
-
newOutputStream
@Nullable @Nullable java.io.OutputStream newOutputStream(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOExceptionCreates a newOutputStreamthat will override its content to the file at the given path. If the file at the given path doesn't exist, it will be created. To finish your modifications, you'll need to close theOutputStream.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- a new
OutputStreamornullif it couldn't be opened - Throws:
java.io.IOException- if an I/O error occurred
-
createFile
boolean createFile(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOExceptionCreates a new file in the given template at the given path if it doesn't exist.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- whether the file was created successfully,
falseif it already exists - Throws:
java.io.IOException- if an I/O error occurred
-
createDirectory
boolean createDirectory(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOExceptionCreates a new directory in the given template at the given path if it doesn't exist.- Parameters:
template- the template where the target file is located atpath- the path to the directory relative to the template- Returns:
- whether the directory was created successfully,
falseif it already exists - Throws:
java.io.IOException- if an I/O error occurred
-
hasFile
boolean hasFile(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOExceptionChecks whether the given path/directory exists in the given template, it doesn't matter if it is a directory or a file.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- whether the file exists
- Throws:
java.io.IOException- if an I/O error occurred
-
deleteFile
boolean deleteFile(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOExceptionDeletes a file in the given template at the given path if it doesn't exist.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- whether the file was deleted successfully,
falseif it already exists - Throws:
java.io.IOException- if an I/O error occurred
-
newInputStream
@Nullable @Nullable java.io.InputStream newInputStream(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOExceptionCreates a newInputStreamwith the data of the file at the given path in the given template.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- the new
InputStreamornullif the file doesn't exist/is a directory - Throws:
java.io.IOException- if an I/O error occurred
-
getFileInfo
@Nullable @Nullable FileInfo getFileInfo(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOException
Retrieves information about a specified file/directory.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- the
FileInfoornullif the file/directory doesn't exist - Throws:
java.io.IOException- if an I/O error occurred
-
listFiles
@Nullable @Nullable FileInfo[] listFiles(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String dir, boolean deep) throws java.io.IOException
Lists all files in the given directory.- Parameters:
template- the template where the target file is located atdir- the directorydeep- whether the contents of sub directories should also be discovered- Returns:
- a list of all files in the given directory or
nullif the given directory doesn't exist/is not a directory - Throws:
java.io.IOException- if an I/O error occurred
-
listFiles
@Nullable default @Nullable FileInfo[] listFiles(@NotNull @NotNull ServiceTemplate template, boolean deep) throws java.io.IOException
Lists all files in the root directory of the template.- Parameters:
template- the template where the target file is located atdeep- whether the contents of sub directories should also be discovered- Returns:
- a list of all files in the given directory or
nullif the given directory doesn't exist/is not a directory - Throws:
java.io.IOException- if an I/O error occurred
-
listFiles
@Nullable default @Nullable FileInfo[] listFiles(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String dir) throws java.io.IOException
Lists all files in the given directory (including sub directories).- Parameters:
template- the template where the target file is located atdir- the directory- Returns:
- a list of all files in the given directory or
nullif the given directory doesn't exist/is not a directory - Throws:
java.io.IOException- if an I/O error occurred
-
listFiles
@Nullable default @Nullable FileInfo[] listFiles(@NotNull @NotNull ServiceTemplate template) throws java.io.IOException
Lists all files in the root directory of the template (including sub directories).- Parameters:
template- the template where the target file is located at- Returns:
- a list of all files in the given directory or
nullif the given directory doesn't exist/is not a directory - Throws:
java.io.IOException- if an I/O error occurred
-
getTemplates
@NotNull @NotNull java.util.Collection<ServiceTemplate> getTemplates()
Gets a list of all templates that exist in this storage. Modifications to the collection won't have any effect.- Returns:
- a list of all templates
-
close
void close() throws java.io.IOExceptionCloses this storage, after it has been closed, no more interaction to this storage should be done and might lead to errors.- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.io.IOException- if an I/O error occurred
-
deployAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deployAsync(@NotNull @NotNull java.nio.file.Path directory, @NotNull @NotNull ServiceTemplate target, @Nullable @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)Deploys the following directory files to the target template storage. If the given file filter is not null, method will apply every single file to the given file filter and only deploy files that were allowed by the filter.- Parameters:
directory- the directory to be deployedtarget- the template to be deployed tofileFilter- the filter for files that should be deployed- Returns:
- whether it was copied successfully
-
deployAsync
@NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deployAsync(@NotNull @NotNull java.nio.file.Path directory, @NotNull @NotNull ServiceTemplate target)Copies the given directory into the given template.- Parameters:
directory- the directory to be deployedtarget- the template to be deployed to- Returns:
- whether it was copied successfully
-
deployAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deployAsync(@NotNull @NotNull java.io.InputStream inputStream, @NotNull @NotNull ServiceTemplate target)Copies the given directory into the given template.- Parameters:
inputStream- the zipped data to be deployedtarget- the template to be deployed to- Returns:
- whether it was copied successfully
-
copyAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> copyAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.nio.file.Path directory)Copies the given template into the given directory- Parameters:
template- the template to copy the files fromdirectory- the target directory to copy the files to- Returns:
- whether it was copied successfully
-
asZipInputStreamAsync
@NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.zip.ZipInputStream> asZipInputStreamAsync(@NotNull @NotNull ServiceTemplate template)Gets a template into aZipInputStream.- Parameters:
template- the template to be zipped- Returns:
- a new
ZipInputStreamor null if it the template doesn't exist
-
zipTemplateAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.InputStream> zipTemplateAsync(@NotNull @NotNull ServiceTemplate template)Zips a template into anInputStream.- Parameters:
template- the template to be zipped- Returns:
- a new
InputStreamor null if it the template doesn't exist
-
deleteAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deleteAsync(@NotNull @NotNull ServiceTemplate template)Deletes the given template if it exists.- Parameters:
template- the template to be deleted- Returns:
- whether the template was successfully deleted,
falseif it doesn't exists
-
createAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> createAsync(@NotNull @NotNull ServiceTemplate template)Creates the given template if it doesn't exists.- Parameters:
template- the template to be deleted- Returns:
- whether the template was successfully created,
falseif it already exists
-
hasAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> hasAsync(@NotNull @NotNull ServiceTemplate template)Checks whether the given template exists.- Parameters:
template- the template to be checked- Returns:
- whether the template exists or not
-
appendOutputStreamAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.OutputStream> appendOutputStreamAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path)Creates a newOutputStreamthat will append its content to the file at the given path. If the file at the given path doesn't exist, it will be created. To finish your modifications, you'll need to close theOutputStream.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- a new
OutputStreamornullif it couldn't be opened
-
newOutputStreamAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.OutputStream> newOutputStreamAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path)Creates a newOutputStreamthat will override its content to the file at the given path. If the file at the given path doesn't exist, it will be created. To finish your modifications, you'll need to close theOutputStream.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- a new
OutputStreamornullif it couldn't be opened
-
createFileAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> createFileAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path)Creates a new file in the given template at the given path if it doesn't exist.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- whether the file was created successfully,
falseif it already exists
-
createDirectoryAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> createDirectoryAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path)Creates a new directory in the given template at the given path if it doesn't exist.- Parameters:
template- the template where the target file is located atpath- the path to the directory relative to the template- Returns:
- whether the directory was created successfully,
falseif it already exists
-
hasFileAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> hasFileAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path)Checks whether the given path/directory exists in the given template, it doesn't matter if it is a directory or a file.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- whether the file exists
-
deleteFileAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deleteFileAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path)Deletes a file in the given template at the given path if it doesn't exist.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- whether the file was deleted successfully,
falseif it already exists
-
newInputStreamAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.InputStream> newInputStreamAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path)Creates a newInputStreamwith the data of the file at the given path in the given template.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- the new
InputStreamornullif the file doesn't exist/is a directory
-
getFileInfoAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo> getFileInfoAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String path)
Retrieves information about a specified file/directory.- Parameters:
template- the template where the target file is located atpath- the path to the file relative to the template- Returns:
- the
FileInfoornullif the file/directory doesn't exist
-
listFilesAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]> listFilesAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String dir, boolean deep)
Lists all files in the given directory.- Parameters:
template- the template where the target file is located atdir- the directorydeep- whether the contents of sub directories should also be discovered- Returns:
- a list of all files in the given directory or
nullif the given directory doesn't exist/is not a directory
-
listFilesAsync
@NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]> listFilesAsync(@NotNull @NotNull ServiceTemplate template, boolean deep)
Lists all files in the root directory of the template.- Parameters:
template- the template where the target file is located atdeep- whether the contents of sub directories should also be discovered- Returns:
- a list of all files in the given directory or
nullif the given directory doesn't exist/is not a directory
-
listFilesAsync
@NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]> listFilesAsync(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull java.lang.String dir)
Lists all files in the given directory (including sub directories).- Parameters:
template- the template where the target file is located atdir- the directory- Returns:
- a list of all files in the given directory or
nullif the given directory doesn't exist/is not a directory
-
listFilesAsync
@NotNull default @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]> listFilesAsync(@NotNull @NotNull ServiceTemplate template)
Lists all files in the root directory of the template (including sub directories).- Parameters:
template- the template where the target file is located at- Returns:
- a list of all files in the given directory or
nullif the given directory doesn't exist/is not a directory
-
getTemplatesAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTemplate>> getTemplatesAsync()
Gets a list of all templates that exist in this storage. Modifications to the collection won't have any effect.- Returns:
- a list of all templates
-
closeAsync
@NotNull @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> closeAsync()
Closes this storage, after it has been closed, no more interaction to this storage should be done and might lead to errors.
-
-