public void put(String name, byte[] content) throws ClientCommandPutException { InputStream ins = new ByteArrayInputStream(content); try { if(!this.ftpClient.storeFile(name, ins)) { throw new ClientCommandPutException("Failed to write input stream to file! [" + name + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } // Close the InputStream once we're finished with it ins.close(); } catch (IOException e) { throw new ClientCommandPutException("Failed to write input stream to file! [" + name + "]", e); //$NON-NLS-1$ //$NON-NLS-2$ } }
public void put(String name, byte[] content) throws ClientCommandPutException { InputStream ins = new ByteArrayInputStream(content); try { if(!this.ftpClient.storeFile(name, ins)) { throw new ClientCommandPutException("Failed to write input stream to file! [" + name + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } // Close the InputStream once we're finished with it ins.close(); } catch (IOException e) { throw new ClientCommandPutException("Failed to write input stream to file! [" + name + "]", e); //$NON-NLS-1$ //$NON-NLS-2$ } }
sb.append(']'); sb.trimToSize(); throw new ClientCommandPutException(sb.toString(), e);
if(outputStream == null) throw new ClientCommandPutException("OutputStream for [" + fileName + "] was null"); throw new ClientCommandPutException("Error on completePendingCommand within 'putWithOutputStream'."); throw new ClientCommandPutException(e);
if(outputStream == null) throw new ClientCommandPutException("OutputStream for [" + fileName + "] was null"); throw new ClientCommandPutException("Error on completePendingCommand within 'putWithOutputStream'."); throw new ClientCommandPutException(e);
/** * Performs an SFTP put, resuming at the designated offset * * @param fileName * * @throws ClientCommandPutException * @throws ClientCommandMkdirException * @throws ClientCommandLsException */ public void putWithOutputStream(String fileName, InputStream inputStream) throws ClientCommandPutException, ClientCommandLsException, ClientCommandMkdirException { try { ensureParentsExist(fileName); channelSftp.put(inputStream, fileName); } catch (SftpException e) { throw new ClientCommandPutException(e); } }
throw new ClientCommandPutException(e); throw new ClientCommandPutException(e); throw new ClientCommandPutException(sb.toString(), e);