Class LocalTemplateStorage

  • All Implemented Interfaces:
    de.dytanic.cloudnet.common.INameable, de.dytanic.cloudnet.driver.template.TemplateStorage, java.lang.AutoCloseable

    public final class LocalTemplateStorage
    extends ClusterSynchronizedTemplateStorage
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable java.io.OutputStream appendOutputStreamWithoutSynchronization​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      void close()  
      boolean copy​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.nio.file.Path directory)  
      boolean createDirectoryWithoutSynchronization​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      boolean createFileWithoutSynchronization​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      boolean createWithoutSynchronization​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)  
      boolean deleteFileWithoutSynchronization​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      boolean deleteWithoutSynchronization​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)  
      boolean deployWithoutSynchronization​(@NotNull java.io.InputStream inputStream, @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target)  
      boolean deployWithoutSynchronization​(@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.FileInfo getFileInfo​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      java.lang.String getName()  
      java.nio.file.Path getStorageDirectory()  
      @NotNull java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate> getTemplates()  
      boolean has​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)  
      boolean hasFile​(@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.InputStream newInputStream​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      @Nullable java.io.OutputStream newOutputStreamWithoutSynchronization​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      @Nullable java.io.InputStream zipTemplate​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)  
      • 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
      • 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.TemplateStorage

        asZipInputStream, deploy, listFiles, listFiles, listFiles, listFilesAsync, listFilesAsync
    • Field Detail

      • LOCAL_TEMPLATE_STORAGE

        public static final java.lang.String LOCAL_TEMPLATE_STORAGE
        See Also:
        Constant Field Values
    • Constructor Detail

      • LocalTemplateStorage

        @Deprecated
        public LocalTemplateStorage​(java.io.File storageDirectory)
        Deprecated.
      • LocalTemplateStorage

        public LocalTemplateStorage​(java.nio.file.Path storageDirectory)
    • 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:
        deployWithoutSynchronization in class ClusterSynchronizedTemplateStorage
      • 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
      • 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:
        appendOutputStreamWithoutSynchronization in class ClusterSynchronizedTemplateStorage
        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:
        newOutputStreamWithoutSynchronization in class ClusterSynchronizedTemplateStorage
        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:
        createFileWithoutSynchronization in class ClusterSynchronizedTemplateStorage
        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:
        createDirectoryWithoutSynchronization in class ClusterSynchronizedTemplateStorage
        Throws:
        java.io.IOException
      • hasFile

        public boolean hasFile​(@NotNull
                               @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template,
                               @NotNull
                               @NotNull java.lang.String path)
      • 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()