Class FTPTemplateStorage
- java.lang.Object
-
- de.dytanic.cloudnet.driver.template.defaults.DefaultSyncTemplateStorage
-
- de.dytanic.cloudnet.ext.storage.ftp.storage.AbstractFTPStorage
-
- de.dytanic.cloudnet.ext.storage.ftp.storage.FTPTemplateStorage
-
- All Implemented Interfaces:
de.dytanic.cloudnet.common.INameable,de.dytanic.cloudnet.driver.template.TemplateStorage,java.lang.AutoCloseable
public final class FTPTemplateStorage extends AbstractFTPStorage
-
-
Field Summary
-
Fields inherited from class de.dytanic.cloudnet.ext.storage.ftp.storage.AbstractFTPStorage
baseDirectory, credentials, ftpType
-
-
Constructor Summary
Constructors Constructor Description FTPTemplateStorage(java.lang.String name, FTPCredentials credentials, boolean ssl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.io.OutputStreamappendOutputStream(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)voidclose()voidcompleteDataTransfer()booleanconnect()booleancopy(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.nio.file.Path directory)booleancreate(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)booleancreateDirectory(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)booleancreateFile(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)booleandelete(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template)booleandeleteFile(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)booleandeploy(@NotNull java.io.InputStream inputStream, @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate target)booleandeploy(@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.FileInfogetFileInfo(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate template, @NotNull java.lang.String path)@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)booleanisAvailable()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.OutputStreamnewOutputStream(@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.ext.storage.ftp.storage.AbstractFTPStorage
getBaseDirectory, getCredentials, getFtpType, getName
-
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
-
-
-
-
Constructor Detail
-
FTPTemplateStorage
public FTPTemplateStorage(java.lang.String name, FTPCredentials credentials, boolean ssl)
-
-
Method Detail
-
connect
public boolean connect()
- Specified by:
connectin classAbstractFTPStorage
-
isAvailable
public boolean isAvailable()
- Specified by:
isAvailablein classAbstractFTPStorage
-
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
-
completeDataTransfer
public void completeDataTransfer()
- Specified by:
completeDataTransferin classAbstractFTPStorage
-
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()
-
-