Package de.dytanic.cloudnet.template
Class LocalTemplateStorage
- java.lang.Object
-
- de.dytanic.cloudnet.driver.template.defaults.DefaultSyncTemplateStorage
-
- de.dytanic.cloudnet.template.ClusterSynchronizedTemplateStorage
-
- de.dytanic.cloudnet.template.LocalTemplateStorage
-
- All Implemented Interfaces:
de.dytanic.cloudnet.common.INameable,de.dytanic.cloudnet.driver.template.TemplateStorage,java.lang.AutoCloseable
public final class LocalTemplateStorage extends ClusterSynchronizedTemplateStorage
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLOCAL_TEMPLATE_STORAGE
-
Constructor Summary
Constructors Constructor Description LocalTemplateStorage(java.io.File storageDirectory)Deprecated.LocalTemplateStorage(java.nio.file.Path storageDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.io.OutputStreamappendOutputStreamWithoutSynchronization(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)voidclose()booleancopy(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.nio.file.Path directory)booleancreateDirectoryWithoutSynchronization(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)booleancreateFileWithoutSynchronization(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)booleancreateWithoutSynchronization(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)booleandeleteFileWithoutSynchronization(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)booleandeleteWithoutSynchronization(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)booleandeployWithoutSynchronization(@NotNull java.io.InputStream inputStream, @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target)booleandeployWithoutSynchronization(@NotNull java.nio.file.Path directory, @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target, @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)@Nullable de.dytanic.cloudnet.driver.template.FileInfogetFileInfo(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)java.lang.StringgetName()java.nio.file.PathgetStorageDirectory()@NotNull java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate>getTemplates()booleanhas(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)booleanhasFile(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)de.dytanic.cloudnet.driver.template.FileInfo[]listFiles(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String dir, boolean deep)@Nullable java.io.InputStreamnewInputStream(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)@Nullable java.io.OutputStreamnewOutputStreamWithoutSynchronization(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)@Nullable java.io.InputStreamzipTemplate(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)-
Methods inherited from class de.dytanic.cloudnet.template.ClusterSynchronizedTemplateStorage
appendOutputStream, create, createDirectory, createFile, delete, deleteFile, deploy, deploy, newOutputStream, requiresSynchronization, toggleSynchronization
-
Methods inherited from class de.dytanic.cloudnet.driver.template.defaults.DefaultSyncTemplateStorage
appendOutputStreamAsync, asZipInputStreamAsync, closeAsync, copyAsync, createAsync, createDirectoryAsync, createFileAsync, deleteAsync, deleteFileAsync, deployAsync, deployAsync, deployAsync, getFileInfoAsync, getTemplatesAsync, hasAsync, hasFileAsync, listFilesAsync, listFilesAsync, newInputStreamAsync, newOutputStreamAsync, zipTemplateAsync
-
-
-
-
Field Detail
-
LOCAL_TEMPLATE_STORAGE
public static final java.lang.String LOCAL_TEMPLATE_STORAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
deployWithoutSynchronization
public boolean deployWithoutSynchronization(@NotNull @NotNull java.nio.file.Path directory, @NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target, @Nullable @Nullable java.util.function.Predicate<java.nio.file.Path> fileFilter)- Specified by:
deployWithoutSynchronizationin classClusterSynchronizedTemplateStorage
-
deployWithoutSynchronization
public boolean deployWithoutSynchronization(@NotNull @NotNull java.io.InputStream inputStream, @NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target)- Specified by:
deployWithoutSynchronizationin classClusterSynchronizedTemplateStorage
-
copy
public boolean copy(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.nio.file.Path directory)
-
zipTemplate
@Nullable public @Nullable java.io.InputStream zipTemplate(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template) throws java.io.IOException- Throws:
java.io.IOException
-
deleteWithoutSynchronization
public boolean deleteWithoutSynchronization(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)- Specified by:
deleteWithoutSynchronizationin classClusterSynchronizedTemplateStorage
-
createWithoutSynchronization
public boolean createWithoutSynchronization(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)- Specified by:
createWithoutSynchronizationin classClusterSynchronizedTemplateStorage
-
has
public boolean has(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)
-
appendOutputStreamWithoutSynchronization
@Nullable public @Nullable java.io.OutputStream appendOutputStreamWithoutSynchronization(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
appendOutputStreamWithoutSynchronizationin classClusterSynchronizedTemplateStorage- Throws:
java.io.IOException
-
newOutputStreamWithoutSynchronization
@Nullable public @Nullable java.io.OutputStream newOutputStreamWithoutSynchronization(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
newOutputStreamWithoutSynchronizationin classClusterSynchronizedTemplateStorage- Throws:
java.io.IOException
-
createFileWithoutSynchronization
public boolean createFileWithoutSynchronization(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
createFileWithoutSynchronizationin classClusterSynchronizedTemplateStorage- Throws:
java.io.IOException
-
createDirectoryWithoutSynchronization
public boolean createDirectoryWithoutSynchronization(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOException- Specified by:
createDirectoryWithoutSynchronizationin classClusterSynchronizedTemplateStorage- Throws:
java.io.IOException
-
hasFile
public boolean hasFile(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String path)
-
deleteFileWithoutSynchronization
public boolean deleteFileWithoutSynchronization(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String path)- Specified by:
deleteFileWithoutSynchronizationin classClusterSynchronizedTemplateStorage
-
newInputStream
@Nullable public @Nullable java.io.InputStream newInputStream(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
getFileInfo
@Nullable public @Nullable de.dytanic.cloudnet.driver.template.FileInfo getFileInfo(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
listFiles
public de.dytanic.cloudnet.driver.template.FileInfo[] listFiles(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull @NotNull java.lang.String dir, boolean deep) throws java.io.IOException- Throws:
java.io.IOException
-
getTemplates
@NotNull public @NotNull java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate> getTemplates()
-
close
public void close()
-
getStorageDirectory
public java.nio.file.Path getStorageDirectory()
-
getName
public java.lang.String getName()
-
-