Interface FileSystemExceptionFactory
-
- All Known Implementing Classes:
DefaultFileSystemExceptionFactory
public interface FileSystemExceptionFactoryA factory for creatingFileSystemExceptions based on replies from an SFTP server.It's often not possible to distinguish different types of errors without inspecting the error message. This interface allows users to provide their own mapping, based on
SftpExceptions.- Author:
- Rob Spoor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileSystemExceptioncreateChangeWorkingDirectoryException(String directory, SftpException exception)Creates aFileSystemExceptionthat indicates a directory cannot be used as the current working directory.FileSystemExceptioncreateCopyException(String file, String other, SftpException exception)Creates aFileSystemExceptionthat indicates a file or directory cannot be copied.FileSystemExceptioncreateCreateDirectoryException(String directory, SftpException exception)Creates aFileSystemExceptionthat indicates a directory cannot be created.FileSystemExceptioncreateDeleteException(String file, SftpException exception, boolean isDirectory)Creates aFileSystemExceptionthat indicates a file or directory cannot be deleted.FileSystemExceptioncreateGetFileException(String file, SftpException exception)Creates aFileSystemExceptionthat indicates a file or directory cannot be retrieved.FileSystemExceptioncreateListFilesException(String directory, SftpException exception)Creates aFileSystemExceptionthat indicates the contents of a directory cannot be retrieved.FileSystemExceptioncreateMoveException(String file, String other, SftpException exception)Creates aFileSystemExceptionthat indicates a file or directory cannot be moved.FileSystemExceptioncreateNewInputStreamException(String file, SftpException exception)Creates aFileSystemExceptionthat indicates a file cannot be opened for reading.FileSystemExceptioncreateNewOutputStreamException(String file, SftpException exception, Collection<? extends OpenOption> options)Creates aFileSystemExceptionthat indicates a file cannot be opened for writing.FileSystemExceptioncreateReadLinkException(String link, SftpException exception)Creates aFileSystemExceptionthat indicates a symbolic link cannot be read.FileSystemExceptioncreateSetGroupException(String file, SftpException exception)Creates aFileSystemExceptionthat indicates the group of a file or directory cannot be set.FileSystemExceptioncreateSetModificationTimeException(String file, SftpException exception)Creates aFileSystemExceptionthat indicates the modification time of a file or directory cannot be set.FileSystemExceptioncreateSetOwnerException(String file, SftpException exception)Creates aFileSystemExceptionthat indicates the owner of a file or directory cannot be set.FileSystemExceptioncreateSetPermissionsException(String file, SftpException exception)Creates aFileSystemExceptionthat indicates the permissions of a file or directory cannot be set.
-
-
-
Method Detail
-
createGetFileException
FileSystemException createGetFileException(String file, SftpException exception)
Creates aFileSystemExceptionthat indicates a file or directory cannot be retrieved.- Parameters:
file- A string identifying the file or directory.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createReadLinkException
FileSystemException createReadLinkException(String link, SftpException exception)
Creates aFileSystemExceptionthat indicates a symbolic link cannot be read.- Parameters:
link- A string identifying the symbolic link.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createListFilesException
FileSystemException createListFilesException(String directory, SftpException exception)
Creates aFileSystemExceptionthat indicates the contents of a directory cannot be retrieved.- Parameters:
directory- A string identifying the directory.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createChangeWorkingDirectoryException
FileSystemException createChangeWorkingDirectoryException(String directory, SftpException exception)
Creates aFileSystemExceptionthat indicates a directory cannot be used as the current working directory.- Parameters:
directory- A string identifying the directory.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createCreateDirectoryException
FileSystemException createCreateDirectoryException(String directory, SftpException exception)
Creates aFileSystemExceptionthat indicates a directory cannot be created.- Parameters:
directory- A string identifying the directory.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createDeleteException
FileSystemException createDeleteException(String file, SftpException exception, boolean isDirectory)
Creates aFileSystemExceptionthat indicates a file or directory cannot be deleted.- Parameters:
file- A string identifying the file or directory.exception- TheSftpExceptionthat was thrown.isDirectory-trueif a directory cannot be deleted, orfalseif a file cannot be deleted.- Returns:
- The created
FileSystemException.
-
createNewInputStreamException
FileSystemException createNewInputStreamException(String file, SftpException exception)
Creates aFileSystemExceptionthat indicates a file cannot be opened for reading.- Parameters:
file- A string identifying the file.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createNewOutputStreamException
FileSystemException createNewOutputStreamException(String file, SftpException exception, Collection<? extends OpenOption> options)
Creates aFileSystemExceptionthat indicates a file cannot be opened for writing.- Parameters:
file- A string identifying the file.exception- TheSftpExceptionthat was thrown.options- The open options used to open the file.- Returns:
- The created
FileSystemException.
-
createCopyException
FileSystemException createCopyException(String file, String other, SftpException exception)
Creates aFileSystemExceptionthat indicates a file or directory cannot be copied.- Parameters:
file- A string identifying the file or directory to be copied.other- A string identifying the file or directory to be copied to.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createMoveException
FileSystemException createMoveException(String file, String other, SftpException exception)
Creates aFileSystemExceptionthat indicates a file or directory cannot be moved.- Parameters:
file- A string identifying the file or directory to be moved.other- A string identifying the file or directory to be moved to.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createSetOwnerException
FileSystemException createSetOwnerException(String file, SftpException exception)
Creates aFileSystemExceptionthat indicates the owner of a file or directory cannot be set.- Parameters:
file- A string identifying the file or directory to set the owner of.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createSetGroupException
FileSystemException createSetGroupException(String file, SftpException exception)
Creates aFileSystemExceptionthat indicates the group of a file or directory cannot be set.- Parameters:
file- A string identifying the file or directory to set the group of.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createSetPermissionsException
FileSystemException createSetPermissionsException(String file, SftpException exception)
Creates aFileSystemExceptionthat indicates the permissions of a file or directory cannot be set.- Parameters:
file- A string identifying the file or directory to set the permissions of.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
createSetModificationTimeException
FileSystemException createSetModificationTimeException(String file, SftpException exception)
Creates aFileSystemExceptionthat indicates the modification time of a file or directory cannot be set.- Parameters:
file- A string identifying the file or directory to set the modification time of.exception- TheSftpExceptionthat was thrown.- Returns:
- The created
FileSystemException.
-
-