@Test public void testAdd() throws Exception { FtpFileConnection conn = sample(); VirtualFile file = conn.getFile("pom.xml"); assertFalse(file.exists()); VirtualFile pom = VFS.getChild(new File("pom.xml").getAbsolutePath()); conn.add(pom.openStream(), pom.getName()); assertTrue(file.exists()); conn.close(); conn = sample(); assertTrue(file.isFile()); assertNotNull(file.openStream()); conn.close(); }
@Override public void add(InputStream in, String path) throws TranslatorException { try { this.client.storeFile(path, in); } catch (IOException e) { throw new TranslatorException(e, UTIL.getString("ftp_failed_write", path, this.client.getReplyString())); } }
FtpFileConnection implements VirtualFileConnection { @Override public void add(InputStream in, String path) throws TranslatorException { try { this.client.storeFile(path, in); } catch (IOException e) { throw new TranslatorException(e, UTIL.getString("ftp_failed_write", path, this.client.getReplyString())); } } }
FtpFileConnection implements VirtualFileConnection { @Override public void add(InputStream in, String path) throws TranslatorException { try { this.client.storeFile(path, in); } catch (IOException e) { throw new TranslatorException(e, UTIL.getString("ftp_failed_write", path, this.client.getReplyString())); } } FtpFileConnection(FtpConfiguration config); }
FtpFileConnection implements VirtualFileConnection { @Override public void add(InputStream in, String path) throws TranslatorException { try { this.client.storeFile(path, in); } catch (IOException e) { throw new TranslatorException(e, UTIL.getString("ftp_failed_write", path, this.client.getReplyString())); } } FtpFileConnection(FtpConfiguration config); @Override void close(); @Override org.teiid.file.VirtualFile[] getFiles(String pattern); VirtualFile getFile(String path); @Override void add(InputStream in, String path); @Override boolean remove(String path); @Override boolean areFilesUsableAfterClose(); }
FtpFileConnection implements VirtualFileConnection { @Override public void add(InputStream in, String path) throws TranslatorException { try { this.client.storeFile(path, in); } catch (IOException e) { throw new TranslatorException(e, UTIL.getString("ftp_failed_write", path, this.client.getReplyString())); } } FtpFileConnection(FtpConfiguration config); @Override void close(); @Override org.teiid.file.VirtualFile[] getFiles(String pattern); VirtualFile getFile(String path); @Override void add(InputStream in, String path); @Override boolean remove(String path); @Override boolean areFilesUsableAfterClose(); static final BundleUtil UTIL; }