private void save(JcrPackageDefinitionImpl def) { for (int i=0; i<PROPERTY_NAMES.length; i++) { if (values[i] != null) { try { def.defNode.setProperty(PROPERTY_NAMES[i], values[i]); } catch (RepositoryException e) { log.error("Error while setting {}: {}", PROPERTY_NAMES[i], e.toString()); } } } } }
@Override public String toString() { try { return getValue(Type.STRING, index); } catch (RepositoryException e) { return e.toString(); } }
@Override public long getContentLength() { long size = this.contentLength; try { size = binary != null ? binary.getSize() : this.contentLength; } catch (RepositoryException e) { logger.info(e.toString()); } return size; }
@Override public InputStream getInputStream() { InputStream is = inputStream; try { is = binary != null ? binary.getStream() : inputStream; } catch (RepositoryException e) { logger.info(e.toString()); } return is; }
@Override public String toString() { try { return getPath(); } catch (RepositoryException e) { return e.toString(); } }
@Override public String toString() { try { return getValue(Type.STRING, index); } catch (RepositoryException e) { return e.toString(); } }
private boolean isValidNameForSession(String name) { if (StringUtils.isEmpty(name)) { return false; } try { mapPrefixedName(name); return true; } catch (RepositoryException e) { LOGGER.error("Error processing namespace for {}: {}", name, e.toString()); return false; } }
private String checkNameSpace(String name) { try { name = mapPrefixedName(name); } catch (RepositoryException e) { LOGGER.error("Error processing namespace for {}: {}", name, e.toString()); } return name; }
private void assertOpen() throws IOException { if (stream == null) { if (closed) { throw new IOException("Stream already closed."); } try { stream = getValue().getStream(); } catch (RepositoryException e) { throw new IOException("Error while opening stream: " + e.toString()); } } } public int read() throws IOException {
/** * {@inheritDoc} */ public Version nextVersion() { if (versions.isEmpty()) { throw new NoSuchElementException(); } NodeId id = versions.removeFirst(); pos++; try { return (Version) session.getNodeById(id); } catch (RepositoryException e) { throw new ConcurrentModificationException("Unable to provide element: " + e.toString()); } }
private void loadConfiguration() { UserSession userSession = (UserSession) org.apache.wicket.Session.get(); Session session = userSession.getJcrSession(); try { Node node = session.getNode(CONFIG_NODE_PATH); this.tableId = node.getProperty("hippogoogleanalytics:tableId").getString(); this.username = node.getProperty("hippogoogleanalytics:username").getString(); this.password = node.getProperty("hippogoogleanalytics:password").getString(); } catch (RepositoryException e) { log.error("Failed to load google analytics configuration: " + e.toString()); } }
/** * {@inheritDoc} * * @return the next frozen node. */ public Node nextNode() { try { return ((Version) next()).getFrozenNode(); } catch (RepositoryException e) { throw (IllegalStateException) new IllegalStateException(e.toString()).initCause(e); } } }
/** * {@inheritDoc} * * @return the next frozen node. */ public Node nextNode() { try { return ((Version) next()).getFrozenNode(); } catch (RepositoryException e) { throw (IllegalStateException) new IllegalStateException(e.toString()).initCause(e); } } }
public ConsoleFile getFile(String path, boolean mustExist) throws IOException { try { VaultFile ret = file.getFileSystem().getFile(file, path); if (ret == null) { throw new FileNotFoundException(path); } return new VaultFsCFile(ret); } catch (RepositoryException e) { throw new IOException(e.toString()); } }
@Override public ObjectBeanManager getObjectBeanManager() { checkStateValidity(); try { return getObjectBeanManager(getSession()); } catch (RepositoryException e) { throw new IllegalStateException("Cannot get ObjectBeanManager. Cause : '"+e.toString()+"'", e); } }
@Override public int size() { try { return (int) getNode().getNodes(name).getSize(); } catch (RepositoryException e) { throw new RepositoryRuntimeException("Failed to determine node list size: " + e.toString(), e); } }
@Override public HstQueryManager getQueryManager() throws IllegalStateException { checkStateValidity(); try { return getQueryManager(getSession()); } catch (RepositoryException e) { throw new IllegalStateException("Cannot get HstQueryManager. Cause : '"+e.toString()+"'", e); } }
@Override public void onOk() { try { final IModel<Node> nodeModel = getModel(); final Node node = nodeModel.getObject().addNode(name, type); modelReference.setModel(new JcrNodeModel(node)); } catch (RepositoryException ex) { error(ex.toString()); } }
@Override public void onOk() { try { JcrNodeModel nodeModel = (JcrNodeModel) getModel(); Node node = nodeModel.getNode().addNode(name, type); modelReference.setModel(new JcrNodeModel(node)); } catch (RepositoryException ex) { error(ex.toString()); } }
@Override public int size() { if (!property.getItemModel().exists()) { return 0; } try { return property.getProperty().getValues().length; } catch (RepositoryException e) { throw new RepositoryRuntimeException("Failed to determine property value list size: " + e.toString(), e); } }