protected final void checkCmisVersion() { if (repositoryInfo.getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } }
protected final void checkCmisVersion() { if (repositoryInfo.getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } }
@Override public OutputStream createOverwriteOutputStream(String filename, String mimeType) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } return new AppendOutputStream(getSession(), this, true, filename, mimeType); }
@Override public OutputStream createOverwriteOutputStream(String filename, String mimeType) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } return new AppendOutputStream(getSession(), this, true, filename, mimeType); }
@Override public OutputStream createOverwriteOutputStream(String filename, String mimeType, int bufferSize) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } return new AppendOutputStream(getSession(), this, true, filename, mimeType, bufferSize); }
@Override public OutputStream createAppendOutputStream(int bufferSize) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } return new AppendOutputStream(getSession(), this, false, null, null, bufferSize); }
@Override public OutputStream createOverwriteOutputStream(String filename, String mimeType, int bufferSize) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } return new AppendOutputStream(getSession(), this, true, filename, mimeType, bufferSize); }
@Override public OutputStream createAppendOutputStream() { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } return new AppendOutputStream(getSession(), this, false, null, null); }
@Override public OutputStream createAppendOutputStream() { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } return new AppendOutputStream(getSession(), this, false, null, null); }
@Override public OutputStream createAppendOutputStream(int bufferSize) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } return new AppendOutputStream(getSession(), this, false, null, null, bufferSize); }
/** * Return the CMIS version of the given repository. */ protected CmisVersion getCmisVersion(String repositoryId) { if (CmisBindingsHelper.getForcedCmisVersion(session) != null) { return CmisBindingsHelper.getForcedCmisVersion(session); } RepositoryInfoCache cache = CmisBindingsHelper.getRepositoryInfoCache(session); RepositoryInfo info = cache.get(repositoryId); if (info == null) { List<RepositoryInfo> infoList = getRepositoriesInternal(repositoryId); if (isNotEmpty(infoList)) { info = infoList.get(0); cache.put(info); } } return info == null ? CmisVersion.CMIS_1_0 : info.getCmisVersion(); }
/** * Return the CMIS version of the given repository. */ protected CmisVersion getCmisVersion(String repositoryId) { if (CmisBindingsHelper.getForcedCmisVersion(session) != null) { return CmisBindingsHelper.getForcedCmisVersion(session); } RepositoryInfoCache cache = CmisBindingsHelper.getRepositoryInfoCache(session); RepositoryInfo info = cache.get(repositoryId); if (info == null) { List<RepositoryInfo> infoList = getRepositoriesInternal(repositoryId); if (isNotEmpty(infoList)) { info = infoList.get(0); cache.put(info); } } return info == null ? CmisVersion.CMIS_1_0 : info.getCmisVersion(); }
@Override public Document appendContentStream(ContentStream contentStream, boolean isLastChunk) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } ObjectId objectId = appendContentStream(contentStream, isLastChunk, true); if (objectId == null) { return null; } if (!getObjectId().equals(objectId.getId())) { return (Document) getSession().getObject(objectId, getCreationContext()); } return this; }
@Override public void run(Session session) { if (session.getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { addResult(createResult(SKIPPED, "Bulk Update Properties is not supported by CMIS 1.0. Test skipped!")); return;
@Override public Document appendContentStream(ContentStream contentStream, boolean isLastChunk) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } ObjectId objectId = appendContentStream(contentStream, isLastChunk, true); if (objectId == null) { return null; } if (!getObjectId().equals(objectId.getId())) { return (Document) getSession().getObject(objectId, getCreationContext()); } return this; }
@Override public void run(Session session) { if (session.getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { addResult(createResult(SKIPPED, "Type mutability is not supported by CMIS 1.0. Test skipped!")); return; } ObjectType parentType = session.getTypeDefinition(getDocumentTestTypeId()); if (parentType.getTypeMutability() == null || !Boolean.TRUE.equals(parentType.getTypeMutability().canCreate())) { addResult(createResult(SKIPPED, "Test document type doesn't allow creating a sub-type. Test skipped!")); return; } createTypeWithoutProperties(session, parentType); createTypeWithProperties(session, parentType); }
/** * Return the CMIS version of the given repository. */ protected CmisVersion getCmisVersion(String repositoryId) { if (CmisBindingsHelper.getForcedCmisVersion(session) != null) { return CmisBindingsHelper.getForcedCmisVersion(session); } RepositoryInfoCache cache = CmisBindingsHelper.getRepositoryInfoCache(session); RepositoryInfo info = cache.get(repositoryId); if (info == null) { info = CmisBindingsHelper.getSPI(session).getRepositoryService().getRepositoryInfo(repositoryId, null); if (info != null) { cache.put(info); } } // if the version is unknown try CMIS 1.0 return info == null ? CmisVersion.CMIS_1_0 : info.getCmisVersion(); } }
@Override public void run(Session session) { if (session.getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { addResult(createResult(SKIPPED, "Secondary types are not supported by CMIS 1.0. Test skipped!")); return;
@Override public ObjectId appendContentStream(ContentStream contentStream, boolean isLastChunk, boolean refresh) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } String newObjectId = null; readLock(); try { Holder<String> objectIdHolder = new Holder<String>(getObjectId()); Holder<String> changeTokenHolder = new Holder<String>((String) getPropertyValue(PropertyIds.CHANGE_TOKEN)); getBinding().getObjectService().appendContentStream(getRepositoryId(), objectIdHolder, changeTokenHolder, getObjectFactory().convertContentStream(contentStream), isLastChunk, null); newObjectId = objectIdHolder.getValue(); } finally { readUnlock(); } if (refresh) { refresh(); } if (newObjectId == null) { return null; } return getSession().createObjectId(newObjectId); }
@Override public ObjectId appendContentStream(ContentStream contentStream, boolean isLastChunk, boolean refresh) { if (getSession().getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { throw new CmisNotSupportedException("This method is not supported for CMIS 1.0 repositories."); } String newObjectId = null; readLock(); try { Holder<String> objectIdHolder = new Holder<String>(getObjectId()); Holder<String> changeTokenHolder = new Holder<String>((String) getPropertyValue(PropertyIds.CHANGE_TOKEN)); getBinding().getObjectService().appendContentStream(getRepositoryId(), objectIdHolder, changeTokenHolder, getObjectFactory().convertContentStream(contentStream), isLastChunk, null); newObjectId = objectIdHolder.getValue(); } finally { readUnlock(); } if (refresh) { refresh(); } if (newObjectId == null) { return null; } return getSession().createObjectId(newObjectId); }