Class DefaultSpecificTemplateStorage
- java.lang.Object
-
- de.dytanic.cloudnet.driver.template.defaults.DefaultSpecificTemplateStorage
-
- All Implemented Interfaces:
de.dytanic.cloudnet.common.INameable,SpecificTemplateStorage
public class DefaultSpecificTemplateStorage extends java.lang.Object implements SpecificTemplateStorage
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.io.OutputStreamappendOutputStream(@NotNull java.lang.String path)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.OutputStream>appendOutputStreamAsync(@NotNull java.lang.String path)@Nullable java.util.zip.ZipInputStreamasZipInputStream()@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.zip.ZipInputStream>asZipInputStreamAsync()booleancopy(@NotNull java.nio.file.Path directory)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>copyAsync(@NotNull java.nio.file.Path directory)booleancreate()@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>createAsync()booleancreateDirectory(@NotNull java.lang.String path)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>createDirectoryAsync(@NotNull java.lang.String path)booleancreateFile(@NotNull java.lang.String path)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>createFileAsync(@NotNull java.lang.String path)booleandelete()@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deleteAsync()booleandeleteFile(@NotNull java.lang.String path)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deleteFileAsync(@NotNull java.lang.String path)booleandeploy(@NotNull java.io.InputStream inputStream)booleandeploy(@NotNull java.nio.file.Path directory, @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deployAsync(@NotNull java.io.InputStream inputStream)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>deployAsync(@NotNull java.nio.file.Path directory, @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)booleanexists()@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>existsAsync()@Nullable FileInfogetFileInfo(@NotNull java.lang.String path)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo>getFileInfoAsync(@NotNull java.lang.String path)java.lang.StringgetName()@NotNull ServiceTemplategetTargetTemplate()Gets the template this class is wrapping.@NotNull TemplateStoragegetWrappedStorage()Gets the storage this class is wrapping.booleanhasFile(@NotNull java.lang.String path)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>hasFileAsync(@NotNull java.lang.String path)FileInfo[]listFiles(boolean deep)FileInfo[]listFiles(@NotNull java.lang.String dir, boolean deep)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]>listFilesAsync(boolean deep)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]>listFilesAsync(@NotNull java.lang.String dir, boolean deep)@Nullable java.io.InputStreamnewInputStream(@NotNull java.lang.String path)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.InputStream>newInputStreamAsync(@NotNull java.lang.String path)@Nullable java.io.OutputStreamnewOutputStream(@NotNull java.lang.String path)@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.OutputStream>newOutputStreamAsync(@NotNull java.lang.String path)static DefaultSpecificTemplateStorageof(@NotNull ServiceTemplate template)Creates a newSpecificTemplateStoragefor the given template.static DefaultSpecificTemplateStorageof(@NotNull ServiceTemplate template, @NotNull TemplateStorage storage)Creates a newSpecificTemplateStoragefor the given template.@Nullable java.io.InputStreamzipTemplate()@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.InputStream>zipTemplateAsync()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.dytanic.cloudnet.driver.template.SpecificTemplateStorage
deploy, deployAsync, listFiles, listFiles, listFilesAsync, listFilesAsync
-
-
-
-
Method Detail
-
of
public static DefaultSpecificTemplateStorage of(@NotNull @NotNull ServiceTemplate template, @NotNull @NotNull TemplateStorage storage)
Description copied from interface:SpecificTemplateStorageCreates a newSpecificTemplateStoragefor the given template.- Parameters:
template- the template which should be wrapped by the given storagestorage- theTemplateStorageinstance matching the name of the storage in the template- Returns:
- a new instance of the
SpecificTemplateStorage
-
of
public static DefaultSpecificTemplateStorage of(@NotNull @NotNull ServiceTemplate template)
Description copied from interface:SpecificTemplateStorageCreates a newSpecificTemplateStoragefor the given template.- Parameters:
template- the template which should be wrapped by the given storage- Returns:
- a new instance of the
SpecificTemplateStorage
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfacede.dytanic.cloudnet.common.INameable
-
getTargetTemplate
@NotNull public @NotNull ServiceTemplate getTargetTemplate()
Description copied from interface:SpecificTemplateStorageGets the template this class is wrapping.- Specified by:
getTargetTemplatein interfaceSpecificTemplateStorage
-
getWrappedStorage
@NotNull public @NotNull TemplateStorage getWrappedStorage()
Description copied from interface:SpecificTemplateStorageGets the storage this class is wrapping.- Specified by:
getWrappedStoragein interfaceSpecificTemplateStorage
-
deploy
public boolean deploy(@NotNull @NotNull java.nio.file.Path directory, @Nullable @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)- Specified by:
deployin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.deploy(Path, ServiceTemplate, Predicate)
-
deploy
public boolean deploy(@NotNull @NotNull java.io.InputStream inputStream)- Specified by:
deployin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.deploy(InputStream, ServiceTemplate)
-
copy
public boolean copy(@NotNull @NotNull java.nio.file.Path directory)- Specified by:
copyin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.copy(ServiceTemplate, Path)
-
asZipInputStream
@Nullable public @Nullable java.util.zip.ZipInputStream asZipInputStream() throws java.io.IOException- Specified by:
asZipInputStreamin interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.asZipInputStream(ServiceTemplate)
-
zipTemplate
@Nullable public @Nullable java.io.InputStream zipTemplate() throws java.io.IOException- Specified by:
zipTemplatein interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.zipTemplate(ServiceTemplate)
-
delete
public boolean delete()
- Specified by:
deletein interfaceSpecificTemplateStorage- See Also:
TemplateStorage.delete(ServiceTemplate)
-
create
public boolean create()
- Specified by:
createin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.create(ServiceTemplate)
-
exists
public boolean exists()
- Specified by:
existsin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.has(ServiceTemplate)
-
appendOutputStream
@Nullable public @Nullable java.io.OutputStream appendOutputStream(@NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
appendOutputStreamin interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.appendOutputStream(ServiceTemplate, String)
-
newOutputStream
@Nullable public @Nullable java.io.OutputStream newOutputStream(@NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
newOutputStreamin interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.newOutputStream(ServiceTemplate, String)
-
createFile
public boolean createFile(@NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
createFilein interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.createFile(ServiceTemplate, String)
-
createDirectory
public boolean createDirectory(@NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
createDirectoryin interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.createDirectory(ServiceTemplate, String)
-
hasFile
public boolean hasFile(@NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
hasFilein interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.hasFile(ServiceTemplate, String)
-
deleteFile
public boolean deleteFile(@NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
deleteFilein interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.deleteFile(ServiceTemplate, String)
-
newInputStream
@Nullable public @Nullable java.io.InputStream newInputStream(@NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
newInputStreamin interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.newInputStream(ServiceTemplate, String)
-
getFileInfo
@Nullable public @Nullable FileInfo getFileInfo(@NotNull @NotNull java.lang.String path) throws java.io.IOException
- Specified by:
getFileInfoin interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.getFileInfo(ServiceTemplate, String)
-
listFiles
public FileInfo[] listFiles(@NotNull @NotNull java.lang.String dir, boolean deep) throws java.io.IOException
- Specified by:
listFilesin interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.listFiles(ServiceTemplate, String, boolean)
-
listFiles
public FileInfo[] listFiles(boolean deep) throws java.io.IOException
- Specified by:
listFilesin interfaceSpecificTemplateStorage- Throws:
java.io.IOException- See Also:
TemplateStorage.listFiles(ServiceTemplate, boolean)
-
deployAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deployAsync(@NotNull @NotNull java.nio.file.Path directory, @Nullable @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)- Specified by:
deployAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.deployAsync(Path, ServiceTemplate, Predicate)
-
deployAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deployAsync(@NotNull @NotNull java.io.InputStream inputStream)- Specified by:
deployAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.deployAsync(InputStream, ServiceTemplate)
-
copyAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> copyAsync(@NotNull @NotNull java.nio.file.Path directory)- Specified by:
copyAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.copyAsync(ServiceTemplate, Path)
-
asZipInputStreamAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.zip.ZipInputStream> asZipInputStreamAsync()
- Specified by:
asZipInputStreamAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.asZipInputStreamAsync(ServiceTemplate)
-
zipTemplateAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.InputStream> zipTemplateAsync()
- Specified by:
zipTemplateAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.zipTemplateAsync(ServiceTemplate)
-
deleteAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deleteAsync()
- Specified by:
deleteAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.deleteAsync(ServiceTemplate)
-
createAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> createAsync()
- Specified by:
createAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.createAsync(ServiceTemplate)
-
existsAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> existsAsync()
- Specified by:
existsAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.hasAsync(ServiceTemplate)
-
appendOutputStreamAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.OutputStream> appendOutputStreamAsync(@NotNull @NotNull java.lang.String path)- Specified by:
appendOutputStreamAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.appendOutputStreamAsync(ServiceTemplate, String)
-
newOutputStreamAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.OutputStream> newOutputStreamAsync(@NotNull @NotNull java.lang.String path)- Specified by:
newOutputStreamAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.newOutputStreamAsync(ServiceTemplate, String)
-
createFileAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> createFileAsync(@NotNull @NotNull java.lang.String path)- Specified by:
createFileAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.createFileAsync(ServiceTemplate, String)
-
createDirectoryAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> createDirectoryAsync(@NotNull @NotNull java.lang.String path)- Specified by:
createDirectoryAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.createDirectoryAsync(ServiceTemplate, String)
-
hasFileAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> hasFileAsync(@NotNull @NotNull java.lang.String path)- Specified by:
hasFileAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.hasFileAsync(ServiceTemplate, String)
-
deleteFileAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deleteFileAsync(@NotNull @NotNull java.lang.String path)- Specified by:
deleteFileAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.deleteFileAsync(ServiceTemplate, String)
-
newInputStreamAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.io.InputStream> newInputStreamAsync(@NotNull @NotNull java.lang.String path)- Specified by:
newInputStreamAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.newInputStreamAsync(ServiceTemplate, String)
-
getFileInfoAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo> getFileInfoAsync(@NotNull @NotNull java.lang.String path)
- Specified by:
getFileInfoAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.getFileInfoAsync(ServiceTemplate, String)
-
listFilesAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]> listFilesAsync(@NotNull @NotNull java.lang.String dir, boolean deep)
- Specified by:
listFilesAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.listFilesAsync(ServiceTemplate, String, boolean)
-
listFilesAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<FileInfo[]> listFilesAsync(boolean deep)
- Specified by:
listFilesAsyncin interfaceSpecificTemplateStorage- See Also:
TemplateStorage.listFilesAsync(ServiceTemplate, boolean)
-
-