Class FTPTemplateStorage

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

    public final class FTPTemplateStorage
    extends AbstractFTPStorage
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable java.io.OutputStream appendOutputStream​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      void close()  
      void completeDataTransfer()  
      boolean connect()  
      boolean copy​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.nio.file.Path directory)  
      boolean create​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)  
      boolean createDirectory​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      boolean createFile​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      boolean delete​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)  
      boolean deleteFile​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      boolean deploy​(@NotNull java.io.InputStream inputStream, @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target)  
      boolean deploy​(@NotNull java.nio.file.Path directory, @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target, java.util.function.Predicate<java.nio.file.Path> filter)  
      @Nullable de.dytanic.cloudnet.driver.template.FileInfo getFileInfo​(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)  
      @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)  
      boolean isAvailable()  
      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 newOutputStream​(@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
    • Constructor Detail

      • FTPTemplateStorage

        public FTPTemplateStorage​(java.lang.String name,
                                  FTPCredentials credentials,
                                  boolean ssl)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • deploy

        public boolean deploy​(@NotNull
                              @NotNull java.nio.file.Path directory,
                              @NotNull
                              @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target,
                              java.util.function.Predicate<java.nio.file.Path> filter)
      • deploy

        public boolean deploy​(@NotNull
                              @NotNull java.io.InputStream inputStream,
                              @NotNull
                              @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target)
      • 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
      • delete

        public boolean delete​(@NotNull
                              @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)
      • create

        public boolean create​(@NotNull
                              @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)
      • has

        public boolean has​(@NotNull
                           @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)
      • appendOutputStream

        @Nullable
        public @Nullable java.io.OutputStream appendOutputStream​(@NotNull
                                                                 @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template,
                                                                 @NotNull
                                                                 @NotNull java.lang.String path)
                                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • newOutputStream

        @Nullable
        public @Nullable java.io.OutputStream newOutputStream​(@NotNull
                                                              @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template,
                                                              @NotNull
                                                              @NotNull java.lang.String path)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • createFile

        public boolean createFile​(@NotNull
                                  @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template,
                                  @NotNull
                                  @NotNull java.lang.String path)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • createDirectory

        public boolean createDirectory​(@NotNull
                                       @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template,
                                       @NotNull
                                       @NotNull java.lang.String path)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • hasFile

        public boolean hasFile​(@NotNull
                               @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template,
                               @NotNull
                               @NotNull java.lang.String path)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteFile

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