@Override protected void execute(final Session session, final String path) throws Exception { // FS that will import FileSystem fs = new FileSystem() { public void beginDirectory(String directoryName) throws IOException { } public void file(String fileName, int length, InputStream data) throws IOException { try { session.getWorkspace().importXML(path, data, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING); } catch (RepositoryException e) { Safe.rethrow(IOException.class, e); } } public void endDirectory(String directoryName) throws IOException { } }; // FileSystemAction.read(this, fs); } }
@Override protected void execute(final Session session, final String path) throws Exception { // FS that will import FileSystem fs = new FileSystem() { public void beginDirectory(String directoryName) throws IOException { } public void file(String fileName, int length, InputStream data) throws IOException { try { session.getWorkspace().importXML(path, data, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING); } catch (RepositoryException e) { Utils.rethrow(IOException.class, e); } } public void endDirectory(String directoryName) throws IOException { } }; // FileSystemAction.read(this, fs); } }
@Override protected void execute(final Session session, final String path) throws Exception { // FS that will import FileSystem fs = new FileSystem() { public void beginDirectory(String directoryName) throws IOException { } public void file(String fileName, int length, InputStream data) throws IOException { try { session.getWorkspace().importXML(path, data, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING); } catch (RepositoryException e) { Utils.rethrow(IOException.class, e); } } public void endDirectory(String directoryName) throws IOException { } }; // FileSystemAction.read(this, fs); } }
public static void read(SCPCommand cmd, FileSystem fs) throws IOException { cmd.ack(); log.log(Level.FINE, "Want to read line"); String line = cmd.readLine(); log.log(Level.FINE, "Read line " + line); FileSystemAction action = decode(line); log.log(Level.FINE, "Action: " + action); read(cmd, action, fs); }
public static void read(SCPCommand cmd, FileSystem fs) throws IOException { cmd.ack(); log.log(Level.FINE, "Want to read line"); String line = cmd.readLine(); log.log(Level.FINE, "Read line " + line); FileSystemAction action = decode(line); log.log(Level.FINE, "Action: " + action); read(cmd, action, fs); }
public static void read(SCPCommand cmd, FileSystem fs) throws IOException { cmd.ack(); log.log(Level.FINE, "Want to read line"); String line = cmd.readLine(); log.log(Level.FINE, "Read line " + line); FileSystemAction action = decode(line); log.log(Level.FINE, "Action: " + action); read(cmd, action, fs); }
break; } else { read(cmd, nextAction, fs);
break; } else { read(cmd, nextAction, fs);
break; } else { read(cmd, nextAction, fs);