Skip to content

Commit

Permalink
Removed unused arguments and implemented createDocument test
Browse files Browse the repository at this point in the history
  • Loading branch information
car031 committed May 16, 2023
1 parent c42da3a commit a2f47ce
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ public ObjectInfo getObjectInfo(String repositoryId, String objectId) {
public String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
VersioningState versioningState, List<String> policies, ExtensionsData extension) {
validateSession();
ObjectData object = getRepository().create(getCallContext(), properties, folderId, contentStream,
versioningState, this);
ObjectData object = getRepository().create(getCallContext(), properties, folderId, contentStream, this);
return object.getId();
}

Expand All @@ -304,7 +303,7 @@ public String createDocument(String repositoryId, Properties properties, String
ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
Acl removeAces, ExtensionsData extension) {
validateSession();
return getRepository().createDocument(getCallContext(), properties, folderId, contentStream, versioningState);
return getRepository().createDocument(getCallContext(), properties, folderId, contentStream);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
import org.apache.chemistry.opencmis.commons.enums.SupportedPermissions;
import org.apache.chemistry.opencmis.commons.enums.Updatability;
import org.apache.chemistry.opencmis.commons.enums.VersioningState;
import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
Expand Down Expand Up @@ -494,13 +493,12 @@ public String createDocumentFromSource(CallContext context, String sourceId, Str
* @param properties the properties
* @param folderId identifier of the parent folder
* @param contentStream stream of the document to create
* @param versioningState state of the version
* @param objectInfos informations
*
* @return the newly created object
*/
public ObjectData create(CallContext context, Properties properties, String folderId, ContentStream contentStream,
VersioningState versioningState, ObjectInfoHandler objectInfos) {
ObjectInfoHandler objectInfos) {
debug("create " + folderId);
validatePermission(folderId, context, Permission.WRITE);

Expand All @@ -512,7 +510,7 @@ public ObjectData create(CallContext context, Properties properties, String fold

String objectId = null;
if (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) {
objectId = createDocument(context, properties, folderId, contentStream, versioningState);
objectId = createDocument(context, properties, folderId, contentStream);
return compileObjectType(context, getDocument(objectId), null, false, false, objectInfos);
} else if (type.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) {
objectId = createFolder(context, properties, folderId);
Expand All @@ -529,12 +527,11 @@ public ObjectData create(CallContext context, Properties properties, String fold
* @param properties the folder's properties
* @param folderId identifier of the parent folder
* @param contentStream binary content of the file to create
* @param versioningState state of the version
*
* @return the new document's identifier
*/
public String createDocument(CallContext context, Properties properties, String folderId,
ContentStream contentStream, VersioningState versioningState) {
ContentStream contentStream) {

log.debug("createDocument {}", folderId);

Expand Down
Loading

0 comments on commit a2f47ce

Please sign in to comment.