int getIndex(DavPropertySet propSet) { int index = Path.INDEX_UNDEFINED; DavProperty<?> indexProp = propSet.get(JcrRemotingConstants.JCR_INDEX_LN, ItemResourceConstants.NAMESPACE); if (indexProp != null && indexProp.getValue() != null) { index = Integer.parseInt(indexProp.getValue().toString()); } return index; }
int getIndex(DavPropertySet propSet) { int index = Path.INDEX_UNDEFINED; DavProperty<?> indexProp = propSet.get(JcrRemotingConstants.JCR_INDEX_LN, ItemResourceConstants.NAMESPACE); if (indexProp != null && indexProp.getValue() != null) { index = Integer.parseInt(indexProp.getValue().toString()); } return index; }
String getUniqueID(DavPropertySet propSet) { DavProperty<?> prop = propSet.get(JcrRemotingConstants.JCR_UUID_LN, ItemResourceConstants.NAMESPACE); if (prop != null) { return prop.getValue().toString(); } else { return null; } }
String getUniqueID(DavPropertySet propSet) { DavProperty<?> prop = propSet.get(JcrRemotingConstants.JCR_UUID_LN, ItemResourceConstants.NAMESPACE); if (prop != null) { return prop.getValue().toString(); } else { return null; } }
/** * @param property Property containing the {@link CalDAVConstants#ELEM_GETETAG} * @return Returns the ETag from the specified Property, null otherwise. */ public static String getEtagfromProperty(DavProperty property){ if(property == null || property.getValue() == null || !property.getName().equals(DavPropertyName.GETETAG)) return null; return property.getValue().toString(); } }
private boolean isDirectory(final URLFileName name) throws IOException { try { final DavProperty property = getProperty(name, DavConstants.PROPERTY_RESOURCETYPE); Node node; if (property != null && (node = (Node) property.getValue()) != null) { return node.getLocalName().equals(DavConstants.XML_COLLECTION); } return false; } catch (final FileNotFoundException fse) { throw new FileNotFolderException(name); } }
private boolean isDirectory(final URLFileName name) throws IOException { try { final DavProperty property = getProperty(name, DavConstants.PROPERTY_RESOURCETYPE); Node node; if (property != null && (node = (Node) property.getValue()) != null) { return node.getLocalName().equals(DavConstants.XML_COLLECTION); } return false; } catch (final FileNotFoundException fse) { throw new FileNotFolderException(name); } }
ItemInfoImpl(DavPropertySet propSet, NamePathResolver resolver) throws NameException, NamespaceException { DavProperty<?> pathProp = propSet.get(JcrRemotingConstants.JCR_PATH_LN, ItemResourceConstants.NAMESPACE); String jcrPath = pathProp.getValue().toString(); path = resolver.getQPath(jcrPath); }
private boolean isDirectory(final URLFileName name) throws IOException { try { final DavProperty property = getProperty(name, DavConstants.PROPERTY_RESOURCETYPE); Node node; if (property != null && (node = (Node) property.getValue()) != null) { return node.getLocalName().equals(DavConstants.XML_COLLECTION); } return false; } catch (final FileNotFoundException fse) { throw new FileNotFolderException(name); } }
/** * Returns the size of the file content (in bytes). */ @Override protected long doGetContentSize() throws Exception { final DavProperty property = getProperty((URLFileName) getName(), DavConstants.PROPERTY_GETCONTENTLENGTH); if (property != null) { final String value = (String) property.getValue(); return Long.parseLong(value); } return 0; }
ItemInfoImpl(DavPropertySet propSet, NamePathResolver resolver) throws NameException, NamespaceException { DavProperty<?> pathProp = propSet.get(JcrRemotingConstants.JCR_PATH_LN, ItemResourceConstants.NAMESPACE); String jcrPath = pathProp.getValue().toString(); path = resolver.getQPath(jcrPath); }
protected int getIntPropertyIfExists(DavPropertySet properties, String alias) { DavProperty property = properties.get(Field.getPropertyName(alias)); if (property == null) { return 0; } else { return Integer.parseInt((String) property.getValue()); } }
protected long getLongPropertyIfExists(DavPropertySet properties, String alias) { DavProperty property = properties.get(Field.getPropertyName(alias)); if (property == null) { return 0; } else { return Long.parseLong((String) property.getValue()); } }
protected double getDoublePropertyIfExists(DavPropertySet properties, String alias) { DavProperty property = properties.get(Field.getResponsePropertyName(alias)); if (property == null) { return 0; } else { return Double.parseDouble((String) property.getValue()); } }
/** * Returns the size of the file content (in bytes). */ @Override protected long doGetContentSize() throws Exception { final DavProperty property = getProperty((URLFileName) getName(), DavConstants.PROPERTY_GETCONTENTLENGTH); if (property != null) { final String value = (String) property.getValue(); return Long.parseLong(value); } return 0; }
/** * Returns the size of the file content (in bytes). */ @Override protected long doGetContentSize() throws Exception { final DavProperty property = getProperty((URLFileName) getName(), DavConstants.PROPERTY_GETCONTENTLENGTH); if (property != null) { final String value = (String) property.getValue(); return Long.parseLong(value); } return 0; }
/** * Returns the last modified time of this file. Is only called if {@link #doGetType} does not return * {@link FileType#IMAGINARY}. */ @Override protected long doGetLastModifiedTime() throws Exception { final DavProperty property = getProperty((URLFileName) getName(), DavConstants.PROPERTY_GETLASTMODIFIED); if (property != null) { final String value = (String) property.getValue(); return DateUtil.parseDate(value).getTime(); } return 0; }
/** * Returns the last modified time of this file. Is only called if {@link #doGetType} does not return * {@link FileType#IMAGINARY}. */ @Override protected long doGetLastModifiedTime() throws Exception { final DavProperty property = getProperty((URLFileName) getName(), DavConstants.PROPERTY_GETLASTMODIFIED); if (property != null) { final String value = (String) property.getValue(); return DateUtil.parseDate(value).getTime(); } return 0; }
/** * Returns the last modified time of this file. Is only called if {@link #doGetType} does not return * {@link FileType#IMAGINARY}. */ @Override protected long doGetLastModifiedTime() throws Exception { final DavProperty property = getProperty((URLFileName) getName(), DavConstants.PROPERTY_GETLASTMODIFIED); if (property != null) { final String value = (String) property.getValue(); return DateUtil.parseDate(value).getTime(); } return 0; }
protected String getURIPropertyIfExists(DavPropertySet properties, String alias) throws URIException { DavProperty property = properties.get(Field.getPropertyName(alias)); if (property == null) { return null; } else { return URIUtil.decode((String) property.getValue()); } }