Class NioFileSystemAdapter
- java.lang.Object
-
- de.codecamp.messages.shared.bundle.NioFileSystemAdapter
-
- All Implemented Interfaces:
FileSystemAdapter<Path,Path>
public class NioFileSystemAdapter extends Object implements FileSystemAdapter<Path,Path>
-
-
Constructor Summary
Constructors Constructor Description NioFileSystemAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateParentDirectories(Path file)voiddeleteIfExists(Path file)booleanexists(Path file)PathgetDirectory(String directoryPath)StringgetDisplayPath(Path dir, Path file)PathgetFile(Path dir, String fileName)StringgetFileName(Path file)StringgetRelativeFilePath(Path dir, Path file)List<Path>listFiles(Path dir, boolean recursive)InputStreamnewInputStream(Path file)OutputStreamnewOutputStream(Path file)
-
-
-
Method Detail
-
getDirectory
public Path getDirectory(String directoryPath)
- Specified by:
getDirectoryin interfaceFileSystemAdapter<Path,Path>
-
listFiles
public List<Path> listFiles(Path dir, boolean recursive) throws IOException
- Specified by:
listFilesin interfaceFileSystemAdapter<Path,Path>- Throws:
IOException
-
getFile
public Path getFile(Path dir, String fileName)
- Specified by:
getFilein interfaceFileSystemAdapter<Path,Path>
-
getFileName
public String getFileName(Path file)
- Specified by:
getFileNamein interfaceFileSystemAdapter<Path,Path>
-
getRelativeFilePath
public String getRelativeFilePath(Path dir, Path file)
- Specified by:
getRelativeFilePathin interfaceFileSystemAdapter<Path,Path>
-
getDisplayPath
public String getDisplayPath(Path dir, Path file)
- Specified by:
getDisplayPathin interfaceFileSystemAdapter<Path,Path>
-
exists
public boolean exists(Path file)
- Specified by:
existsin interfaceFileSystemAdapter<Path,Path>
-
createParentDirectories
public void createParentDirectories(Path file) throws IOException
- Specified by:
createParentDirectoriesin interfaceFileSystemAdapter<Path,Path>- Throws:
IOException
-
deleteIfExists
public void deleteIfExists(Path file) throws IOException
- Specified by:
deleteIfExistsin interfaceFileSystemAdapter<Path,Path>- Throws:
IOException
-
newInputStream
public InputStream newInputStream(Path file) throws IOException
- Specified by:
newInputStreamin interfaceFileSystemAdapter<Path,Path>- Throws:
IOException
-
newOutputStream
public OutputStream newOutputStream(Path file) throws IOException
- Specified by:
newOutputStreamin interfaceFileSystemAdapter<Path,Path>- Throws:
IOException
-
-