public void checkIfUseful(String what) { switch (objecVariant) { case INVALID_ID: throw new CmisInvalidArgumentException(what + " id is invalid: " + objectId); case NOT_EXISTING: throw new CmisObjectNotFoundException(what + " not found: " + objectId); case NOT_A_CMIS_OBJECT: throw new CmisObjectNotFoundException(what + " is not a CMIS object: " + objectId); case PERMISSION_DENIED: throw new CmisPermissionDeniedException("Permission denied!"); } }
/** * @see org.opencms.cmis.I_CmsCmisRepository#deleteContentStream(org.opencms.cmis.CmsCmisCallContext, org.apache.chemistry.opencmis.commons.spi.Holder, org.apache.chemistry.opencmis.commons.spi.Holder) */ public synchronized void deleteContentStream( CmsCmisCallContext context, Holder<String> objectId, Holder<String> changeToken) { throw new CmisConstraintException("Content streams may not be deleted."); }
@Override public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy, Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter, Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) { throw new CmisNotSupportedException(); }
/** * Wrap OpenCms into OpenCMIS exceptions and rethrow them.<p> * * @param e the exception to handle */ public static void handleCmsException(CmsException e) { if (e instanceof CmsVfsResourceNotFoundException) { throw new CmisObjectNotFoundException(e.getLocalizedMessage(), e); } else if (e instanceof CmsSecurityException) { throw new CmisUnauthorizedException(e.getLocalizedMessage(), e); } else { throw new CmisRuntimeException(e.getLocalizedMessage(), e); } }
public boolean handleAuditEntryError(Long entryId, String errorMsg, Throwable error) { throw new CmisRuntimeException("Audit entry " + entryId + ": " + errorMsg, error); } };
/** * Throws an exception if the given properties set is {@code null}. */ protected void checkProperties(Properties properties) { if (properties == null) { throw new CmisInvalidArgumentException("Properties must be set!"); } }
public void checkIfUseful(String what) { switch (objecVariant) { case INVALID_ID: throw new CmisInvalidArgumentException(what + " id is invalid: " + objectId); case NOT_EXISTING: throw new CmisObjectNotFoundException(what + " not found: " + objectId); case NOT_A_CMIS_OBJECT: throw new CmisObjectNotFoundException(what + " is not a CMIS object: " + objectId); case PERMISSION_DENIED: throw new CmisPermissionDeniedException("Permission denied!"); } }
public boolean handleAuditEntryError(Long entryId, String errorMsg, Throwable error) { throw new CmisRuntimeException("Audit entry " + entryId + ": " + errorMsg, error); } };
private void addFieldBytes(int len) { fieldBytes += len; if (fieldBytes > MAX_FIELD_BYTES) { throw new CmisInvalidArgumentException("Limit exceeded!"); } }
@Override public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter, Boolean includeRelativePathSegment, ExtensionsData extension) { throw new CmisNotSupportedException(); }
public static Document newDomDocument() { throw new CmisRuntimeException("This method should never be used on Android!"); } }
private void checkLength() throws IOException { if (counter > max) { throw new CmisInvalidArgumentException("Limit exceeded!"); } }
@Override public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) { throw new CmisNotSupportedException(); }
/** * Throws an exception if the given type definition is {@code null}. */ protected void checkTypeDefinition(TypeDefinition typeDef) { if (typeDef == null) { throw new CmisInvalidArgumentException("Type definition must be set!"); } }
/** * Checks whether we have write access to this repository and throws an exception otherwise.<p> */ protected void checkWriteAccess() { if (m_isReadOnly) { throw new CmisNotSupportedException("Readonly repository '" + m_id + "' does not allow write operations."); } }
/** * Helper method to create exceptions for unsupported features.<p> * * @return the created exception */ protected RuntimeException notSupported() { return new CmisNotSupportedException("Not supported"); }
@Override public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) { throw new CmisNotSupportedException(); } }
@Override public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties, String folderId, VersioningState versioningState, List<String> policies, Acl addACEs, Acl removeACEs, ExtensionsData extension) { throw new CmisNotSupportedException("createDocumentFromSource is not supported by the AtomPub binding!"); }
@Override public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties, String folderId, VersioningState versioningState, List<String> policies, Acl addACEs, Acl removeACEs, ExtensionsData extension) { throw new CmisNotSupportedException("createDocumentFromSource is not supported by the AtomPub binding!"); }
@Override public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) { throw new CmisNotSupportedException(); }