@Override public void endElement(String uri, String localName, String qName) throws SAXException { try { String fileName = XML.fileName(qName); fs.endDirectory(fileName); } catch (IOException e) { throw new SAXException(e); } } }
@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 void endDirectory(String directoryName) throws IOException { out.write("E\n".getBytes()); out.flush(); readAck(); } };
public static Repository findRepository(Map<String, String> properties) throws Exception { for (JCRPlugin plugin : ServiceLoader.load(JCRPlugin.class)) { Repository repository = plugin.getRepository(properties); if (repository != null) { return repository; } } return null; }
public final Property set(Node node, String name, Object value) throws RepositoryException { Value v = wrap(node.getSession().getValueFactory(), value); if (v != null) { try { return node.setProperty(name, v); } catch (ValueFormatException e) { return node.setProperty(name, new Value[]{v}); } } return null; }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { try { String fileName = XML.fileName(qName); fs.endDirectory(fileName); } catch (IOException e) { throw new SAXException(e); } } }
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); }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { try { String fileName = XML.fileName(qName); fs.endDirectory(fileName); } catch (IOException e) { throw new SAXException(e); } } }
public void endDirectory(String directoryName) throws IOException { out.write("E\n".getBytes()); out.flush(); readAck(); } };
public static Repository findRepository(Map<String, String> properties) throws Exception { for (JCRPlugin plugin : ServiceLoader.load(JCRPlugin.class)) { Repository repository = plugin.getRepository(properties); if (repository != null) { return repository; } } return null; }
@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); } }
public final Property set(Node node, String name, Object value) throws RepositoryException { Value v = wrap(node.getSession().getValueFactory(), value); if (v != null) { try { return node.setProperty(name, v); } catch (ValueFormatException e) { return node.setProperty(name, new Value[]{v}); } } return null; }
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 void endDirectory(String directoryName) throws IOException { out.write("E\n".getBytes()); out.flush(); readAck(); } };
public static Repository findRepository(Map<String, String> properties) throws Exception { for (JCRPlugin plugin : ServiceLoader.load(JCRPlugin.class)) { Repository repository = plugin.getRepository(properties); if (repository != null) { return repository; } } return null; }
@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 final Property set(Node node, String name, Object value) throws RepositoryException { Value v = wrap(node.getSession().getValueFactory(), value); if (v != null) { try { return node.setProperty(name, v); } catch (ValueFormatException e) { return node.setProperty(name, new Value[]{v}); } } return null; }
public void beginDirectory(String directoryName) throws IOException { out.write("D0755 0 ".getBytes()); out.write(directoryName.getBytes()); out.write("\n".getBytes()); out.flush(); readAck(); } public void file(String fileName, int length, InputStream data) throws IOException {
public void beginDirectory(String directoryName) throws IOException { out.write("D0755 0 ".getBytes()); out.write(directoryName.getBytes()); out.write("\n".getBytes()); out.flush(); readAck(); } public void file(String fileName, int length, InputStream data) throws IOException {