* @param target The target file or directory that will store the contents
*
* @see #scp(VirtualPath, OutputStream)
*/
public void scp (VirtualPath source, VirtualArtifact target) throws IOException {
VirtualFile file = target instanceof VirtualFile ?
(VirtualFile) target : ((VirtualDirectory)target).createFile(source.getPart(source.getPartCount()-1));
OutputStream output = null;
try {
this.scp(source, output = file.getOutputStream());
} finally {
if (output != null) output.close();
}
}