INT-1664 renamed copy() methods to read(..) and write(..)

This commit is contained in:
Oleg Zhurakousky
2010-12-06 12:37:51 -05:00
parent 5f36b01024
commit f4f0c2ea36
6 changed files with 12 additions and 17 deletions

View File

@@ -178,7 +178,7 @@ public class FileTransferringMessageHandler extends AbstractMessageHandler {
remoteDirectory += File.separatorChar;
}
String remoteFilePath = remoteDirectory + file.getName();
session.copy(fileInputStream, remoteFilePath);
session.write(fileInputStream, remoteFilePath);
fileInputStream.close();
return true;
}

View File

@@ -125,12 +125,12 @@ public class CachingSessionFactory implements SessionFactory, DisposableBean {
return this.targetSession.<F>list(path);
}
public void copy(String source, OutputStream os) throws IOException{
this.targetSession.copy(source, os);
public void read(String source, OutputStream os) throws IOException{
this.targetSession.read(source, os);
}
public void copy(InputStream inputStream, String destination) throws IOException{
this.targetSession.copy(inputStream, destination);
public void write(InputStream inputStream, String destination) throws IOException{
this.targetSession.write(inputStream, destination);
}
public boolean isOpen() {

View File

@@ -35,9 +35,9 @@ public interface Session {
<F> F[] list(String path) throws IOException;
void copy(String source, OutputStream outputStream) throws IOException;
void read(String source, OutputStream outputStream) throws IOException;
void copy(InputStream inputStream, String destination) throws IOException;
void write(InputStream inputStream, String destination) throws IOException;
void close();

View File

@@ -159,7 +159,7 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
InputStream inputStream = null;
FileOutputStream fileOutputStream = new FileOutputStream(tempFile);
try {
session.copy(remoteFilePath, fileOutputStream);
session.read(remoteFilePath, fileOutputStream);
}
catch (Exception e) {
if (e instanceof RuntimeException){