Interface FileManagerService
-
- All Known Implementing Classes:
FileManagerServiceImpl
public interface FileManagerService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
copy(java.nio.file.Path source, java.nio.file.Path destination)
This method copies a file.void
createDirectory(java.nio.file.Path path)
This method creates a object.void
delete(java.nio.file.Path path)
This method deletes a file.byte[]
downloadFile(java.nio.file.Path path)
This method downloads a file.void
extractZipFile(java.nio.file.Path file, java.nio.file.Path destination)
This method extracts a zip file.java.util.List<java.io.File>
findByPath(java.nio.file.Path path)
This method returns a files list.java.util.List<java.io.File>
findByPath(java.nio.file.Path path, java.io.FileFilter filter)
This method returns a files list.java.util.List<java.io.File>
findFiles(java.nio.file.Path path)
This method returns a files list.java.util.List<java.io.File>
findFiles(java.nio.file.Path path, java.lang.String fileExtension)
This method returns a files list.java.util.List<java.io.File>
findRootFolders(java.nio.file.Path rootPath)
This method returns a files list.void
move(java.nio.file.Path source, java.nio.file.Path destination)
This method moves a file.void
rename(java.nio.file.Path file, java.lang.String newName)
This method updates a file name.void
saveContentToFile(java.lang.String name, java.lang.String path, java.lang.String content)
This method saves content in file.void
uploadFile(java.nio.file.Path destination, java.io.InputStream fis)
This method uploads a file.
-
-
-
Method Detail
-
createDirectory
void createDirectory(java.nio.file.Path path)
This method creates a object.- Parameters:
path
- java object, which will be created
-
findByPath
java.util.List<java.io.File> findByPath(java.nio.file.Path path)
This method returns a files list.- Parameters:
path
- to java object, with which the file will be found- Returns:
- files as list
-
findByPath
java.util.List<java.io.File> findByPath(java.nio.file.Path path, java.io.FileFilter filter)
This method returns a files list.- Parameters:
path
- to java object, with which the file will be foundfilter
- file filter object- Returns:
- files as list
-
findFiles
java.util.List<java.io.File> findFiles(java.nio.file.Path path)
This method returns a files list.- Parameters:
path
- to java object, with which the file will be found- Returns:
- files as list
-
findFiles
java.util.List<java.io.File> findFiles(java.nio.file.Path path, java.lang.String fileExtension)
This method returns a files list.- Parameters:
path
- to java object, with which the file will be foundfileExtension
- extension to filter files- Returns:
- files as list
-
findRootFolders
java.util.List<java.io.File> findRootFolders(java.nio.file.Path rootPath)
This method returns a files list.- Parameters:
rootPath
- to files, with which the file will be found- Returns:
- files as list
-
uploadFile
void uploadFile(java.nio.file.Path destination, java.io.InputStream fis)
This method uploads a file.- Parameters:
destination
- path to file, with which the file will be foundfis
- is a stream, with which the file will be uploaded
-
downloadFile
byte[] downloadFile(java.nio.file.Path path)
This method downloads a file.- Parameters:
path
- path to file, with which the file will be found- Returns:
- data as byte array
-
move
void move(java.nio.file.Path source, java.nio.file.Path destination)
This method moves a file.- Parameters:
source
- path to file, with which the file will be founddestination
- path to file, with which the file will be found
-
copy
void copy(java.nio.file.Path source, java.nio.file.Path destination)
This method copies a file.- Parameters:
source
- path to file, with which the file will be founddestination
- path to file, with which the file will be found
-
rename
void rename(java.nio.file.Path file, java.lang.String newName)
This method updates a file name.- Parameters:
file
- path to file, with which the file will be foundnewName
- name value, which will be set file
-
delete
void delete(java.nio.file.Path path)
This method deletes a file.- Parameters:
path
- path to file, with which the file will be found
-
extractZipFile
void extractZipFile(java.nio.file.Path file, java.nio.file.Path destination)
This method extracts a zip file.- Parameters:
file
- path of file, with which the file will be uploadeddestination
- path to file, with which the file will be found
-
saveContentToFile
void saveContentToFile(java.lang.String name, java.lang.String path, java.lang.String content)
This method saves content in file.- Parameters:
name
- is a value, with which the file will be foundpath
- path to file, with which the file will be foundcontent
- content, which will be saved in file
-
-