/** * Graceful {@link #stat(String)} that returns null if the path doesn't exist. */ public SFTPv3FileAttributes _stat(String path) throws IOException { try { return stat(path); } catch (SFTPException e) { int c = e.getServerErrorCode(); if (c== ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH) return null; else throw e; } }
private void expectStatusOKMessage(int id) throws IOException { byte[] resp = receiveMessage(34000); if (debug != null) { debug.println("Got REPLY."); debug.flush(); } TypesReader tr = new TypesReader(resp); int t = tr.readByte(); int rep_id = tr.readUINT32(); if (rep_id != id) throw new IOException("The server sent an invalid id field."); if (t != Packet.SSH_FXP_STATUS) throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")"); int errorCode = tr.readUINT32(); if (errorCode == ErrorCodes.SSH_FX_OK) return; throw new SFTPException(tr.readString(), errorCode); }
SFTPException(String msg, int errorCode) { super(constructMessage(msg, errorCode)); sftpErrorMessage = msg; sftpErrorCode = errorCode; }
private void expectStatusOKMessage(int id) throws IOException { byte[] resp = receiveMessage(34000); if (debug != null) { debug.println("Got REPLY."); debug.flush(); } TypesReader tr = new TypesReader(resp); int t = tr.readByte(); int rep_id = tr.readUINT32(); if (rep_id != id) throw new IOException("The server sent an invalid id field."); if (t != Packet.SSH_FXP_STATUS) throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")"); int errorCode = tr.readUINT32(); if (errorCode == ErrorCodes.SSH_FX_OK) return; throw new SFTPException(tr.readString(), errorCode); }
SFTPException(String msg, int errorCode) { super(constructMessage(msg, errorCode)); sftpErrorMessage = msg; sftpErrorCode = errorCode; }
private void expectStatusOKMessage(int id) throws IOException { byte[] resp = receiveMessage(34000); if (debug != null) { debug.println("Got REPLY."); debug.flush(); } TypesReader tr = new TypesReader(resp); int t = tr.readByte(); int rep_id = tr.readUINT32(); if (rep_id != id) throw new IOException("The server sent an invalid id field."); if (t != Packet.SSH_FXP_STATUS) throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")"); int errorCode = tr.readUINT32(); if (errorCode == ErrorCodes.SSH_FX_OK) return; throw new SFTPException(tr.readString(), errorCode); }
/** * Graceful {@link #stat(String)} that returns null if the path doesn't exist. */ public SFTPv3FileAttributes _stat(String path) throws IOException { try { return stat(path); } catch (SFTPException e) { int c = e.getServerErrorCode(); if (c==ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH) return null; else throw e; } }
SFTPException(String msg, int errorCode) { super(constructMessage(msg, errorCode)); sftpErrorMessage = msg; sftpErrorCode = errorCode; }
throw new SFTPException(tr.readString(), errorCode);
/** * Graceful {@link #stat(String)} that returns null if the path doesn't exist. */ public SFTPv3FileAttributes _stat(String path) throws IOException { try { return stat(path); } catch (SFTPException e) { int c = e.getServerErrorCode(); if (c== ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH) return null; else throw e; } }
String errorMessage = tr.readString(); throw new SFTPException(errorMessage, errorCode);
/** * Graceful {@link #stat(String)} that returns null if the path doesn't exist. */ public SFTPv3FileAttributes _stat(String path) throws IOException { try { return stat(path); } catch (SFTPException e) { int c = e.getServerErrorCode(); if (c== ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH) return null; else throw e; } }
throw new SFTPException(tr.readString(), errorCode);
/** * Graceful {@link #stat(String)} that returns null if the path doesn't exist. */ public SFTPv3FileAttributes _stat(String path) throws IOException { try { return stat(path); } catch (SFTPException e) { int c = e.getServerErrorCode(); if (c== ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH) return null; else throw e; } }
String errorMessage = tr.readString(); throw new SFTPException(errorMessage, errorCode);
/** * Graceful {@link #stat(String)} that returns null if the path doesn't exist. * @param path directory path. * @throws IOException if it is not possible to access to the directory. */ public SFTPv3FileAttributes _stat(String path) throws IOException { try { return stat(path); } catch (SFTPException e) { int c = e.getServerErrorCode(); if (c==ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH) return null; else throw e; } }
throw new SFTPException(tr.readString(), errorCode);
/** * Graceful {@link #stat(String)} that returns null if the path doesn't exist. * @param path directory path. * @throws IOException if it is not possible to access to the directory. */ public SFTPv3FileAttributes _stat(String path) throws IOException { try { return stat(path); } catch (SFTPException e) { int c = e.getServerErrorCode(); if (c==ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH) return null; else throw e; } }
String errorMessage = tr.readString(); throw new SFTPException(errorMessage, errorCode);
/** * Graceful {@link #stat(String)} that returns null if the path doesn't exist. * * @param path the path * @return the sft pv 3 file attributes * @throws IOException the io exception */ public SFTPv3FileAttributes _stat(String path) throws IOException { try { return stat(path); } catch (SFTPException e) { int c = e.getServerErrorCode(); if (c== ErrorCodes.SSH_FX_NO_SUCH_FILE || c==ErrorCodes.SSH_FX_NO_SUCH_PATH) return null; else throw e; } }