Java Code Examples for org.springframework.extensions.surf.util.ParameterCheck

The following examples show how to use org.springframework.extensions.surf.util.ParameterCheck. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * General conversion method to Object types (note it cannot support
 * conversion to primary types due the restrictions of reflection. Use the
 * static conversion methods to primitive types)
 * 
 * @param propertyType - the target property type
 * @param value - the value to be converted
 * @return - the converted value as the correct type
 */
public final Object convert(DataTypeDefinition propertyType, Object value)
{
    ParameterCheck.mandatory("Property type definition", propertyType);
    
    // Convert property type to java class
    Class<?> javaClass = null;
    String javaClassName = propertyType.getJavaClassName();
    try
    {
        javaClass = Class.forName(javaClassName);
    }
    catch (ClassNotFoundException e)
    {
        throw new DictionaryException("Java class " + javaClassName + " of property type " + propertyType.getName() + " is invalid", e);
    }
    
    return convert(javaClass, value);
}
 
Example 2
/**
 * General conversion method to convert collection contents to the specified
 * type.
 * 
 * @param propertyType - the target property type
 * @param values - the value to be converted
 * @return - the converted value as the correct type
 * @throws DictionaryException if the property type's registered java class is invalid
 * @throws TypeConversionException if the conversion cannot be performed
 */
public final Collection<?> convert(DataTypeDefinition propertyType, Collection<?> values)
{
    ParameterCheck.mandatory("Property type definition", propertyType);
    
    // Convert property type to java class
    Class<?> javaClass = null;
    String javaClassName = propertyType.getJavaClassName();
    try
    {
        javaClass = Class.forName(javaClassName);
    }
    catch (ClassNotFoundException e)
    {
        throw new DictionaryException("Java class " + javaClassName + " of property type " + propertyType.getName() + " is invalid", e);
    }
    
    return convert(javaClass, values);
}
 
Example 3
/**
 * Remove an authority (a user or group) from a group
 * 
 * @param parentGroup   The parent container group
 * @param authority     The authority (user or group) to remove
 */
public void removeAuthority(ScriptNode parentGroup, ScriptNode authority)
{
    ParameterCheck.mandatory("Authority", authority);
    ParameterCheck.mandatory("ParentGroup", parentGroup);
    if (parentGroup.getQNameType().equals(ContentModel.TYPE_AUTHORITY_CONTAINER))
    {
        String parentGroupName = (String)parentGroup.getProperties().get(ContentModel.PROP_AUTHORITY_NAME);
        String authorityName;
        if (authority.getQNameType().equals(ContentModel.TYPE_AUTHORITY_CONTAINER))
        {
            authorityName = (String)authority.getProperties().get(ContentModel.PROP_AUTHORITY_NAME);
        }
        else
        {
            authorityName = (String)authority.getProperties().get(ContentModel.PROP_USERNAME);
        }
        authorityService.removeAuthority(parentGroupName, authorityName);
    }
}
 
Example 4
/**
* {@inheritDoc}
 */
@Extend(traitAPI=WorkflowPackageTrait.class,extensionAPI=WorkflowPackageExtension.class)
public List<String> getWorkflowIdsForContent(NodeRef packageItem)
{
    ParameterCheck.mandatory("packageItem", packageItem);
    List<String> workflowIds = new ArrayList<String>();
    if (nodeService.exists(packageItem))
    {
        List<ChildAssociationRef> parentAssocs = nodeService.getParentAssocs(packageItem);
        for (ChildAssociationRef parentAssoc : parentAssocs)
        {
            NodeRef parentRef = parentAssoc.getParentRef();
            if (nodeService.hasAspect(parentRef, WorkflowModel.ASPECT_WORKFLOW_PACKAGE)
                        && !nodeService.hasAspect(parentRef, ContentModel.ASPECT_ARCHIVED))
            {
                String workflowInstance = (String) nodeService.getProperty(parentRef,
                            WorkflowModel.PROP_WORKFLOW_INSTANCE_ID);
                if (workflowInstance != null && workflowInstance.length() > 0)
                {
                    workflowIds.add(workflowInstance);
                }
            }
        }
    }
    return workflowIds;
}
 
Example 5
public void postActivity(String activityType, String siteId, String appTool, NodeRef nodeRef, String name, QName typeQName, NodeRef parentNodeRef)
{
    // primarily for delete node activities - eg. delete document, delete folder
    
    ParameterCheck.mandatory("nodeRef", nodeRef);
    ParameterCheck.mandatory("typeQName", typeQName);
    ParameterCheck.mandatory("parentNodeRef", parentNodeRef);
    
    StringBuffer sb = new StringBuffer();
    sb.append("{").append("\""+PostLookup.JSON_NODEREF_LOOKUP+"\":\"").append(nodeRef.toString()).append("\"").append(",")
                  .append("\""+PostLookup.JSON_NAME+"\":\"").append(name).append("\"").append(",")
                  .append("\""+PostLookup.JSON_TYPEQNAME+"\":\"").append(typeQName.toPrefixString()).append("\"").append(",") // TODO toPrefixString does not return prefix ??!!
                  .append("\""+PostLookup.JSON_NODEREF_PARENT+"\":\"").append(parentNodeRef.toString()).append("\"")
                  .append("}");
    
    postActivity(activityType, siteId, appTool, sb.toString(), ActivityPostEntity.STATUS.PENDING, getCurrentUser(), null,null);
}
 
Example 6
/**
 * Call all {@link TenantDeployer#onEnableTenant() TenantDeployers} as the system tenant.
 */
protected void notifyAfterEnableTenant(String tenantDomain)
{
    // Check that all the passed values are not null
    ParameterCheck.mandatory("tenantDomain", tenantDomain);
    
    // notify listeners that tenant has been enabled
    TenantUtil.runAsSystemTenant(new TenantRunAsWork<Object>()
    {
        public Object doWork()
        {
            for (TenantDeployer tenantDeployer : tenantDeployers)
            {
                tenantDeployer.onEnableTenant();
            }
            return null;
        }
    }, tenantDomain);
    
    if (logger.isDebugEnabled())
    {
        logger.debug("Tenant enabled: " + tenantDomain);
    }
}
 
Example 7
public List<FeedControl> getFeedControls(String userId)
{
    ParameterCheck.mandatoryString("userId", userId);
    
    if (! userNamesAreCaseSensitive)
    {
        userId = userId.toLowerCase();
    }
    
    String currentUser = getCurrentUser();
    
    if ((currentUser == null) || 
        (! ((authorityService.isAdminAuthority(currentUser)) ||
            (currentUser.equals(userId)) ||
            (AuthenticationUtil.getSystemUserName().equals(this.tenantService.getBaseNameUser(currentUser))))))
    {
        throw new AlfrescoRuntimeException("Current user " + currentUser + " is not permitted to get feed controls for " + userId);
    }
    
    return getFeedControlsImpl(userId);
}
 
Example 8
public void exportView(ExportPackageHandler exportHandler, ExporterCrawlerParameters parameters, Exporter progress)
{
    ParameterCheck.mandatory("Stream Handler", exportHandler);

    // create exporter around export handler
    exportHandler.startExport();
    OutputStream dataFile = exportHandler.createDataStream();
    Exporter xmlExporter = createXMLExporter(dataFile, parameters.getReferenceType());
    URLExporter urlExporter = new URLExporter(xmlExporter, exportHandler);

    // export        
    exportView(urlExporter, parameters, progress);
    
    // end export
    exportHandler.endExport();
}
 
Example 9
private Long getApplicationId(String applicationName)
{
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(true);

    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return null;
    }

    return application.getApplicationId();
}
 
Example 10
/**
 * {@inheritDoc}
 * @since 3.2
 */
public void resetDisabledPaths(String applicationName)
{
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(true);
    
    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return;
    }
    Long disabledPathsId = application.getDisabledPathsId();
    propertyValueDAO.updateProperty(disabledPathsId, (Serializable) Collections.emptySet());
    // Done
    if (logger.isDebugEnabled())
    {
        logger.debug("Removed all disabled paths for application " + applicationName);
    }
}
 
Example 11
@Override
public boolean isEnabledTenant(String tenantDomain)
{       
    // Check that all the passed values are not null
    ParameterCheck.mandatory("tenantDomain", tenantDomain);
    
    tenantDomain = getTenantDomain(tenantDomain);
    
    Tenant tenant = getTenantAttributes(tenantDomain);
    if (tenant != null)
    {
        return tenant.isEnabled();
    }
    
    return false;
}
 
Example 12
/** 
 * Execute script
 * 
 * @param location  the classpath string locating the script
 * @param model     the context model
 * @return Object   the result of the script
 */
protected Object execute(ScriptProcessor processor, String location, Map<String, Object> model)
{
    ParameterCheck.mandatoryString("location", location);
    if (logger.isDebugEnabled())
    {
        logger.debug("Executing script:\n" + location);
    }
    try
    {
        return processor.execute(location, model);
    }
    catch (Throwable err)
    {
        throw translateProcessingException(location, err);
    }
}
 
Example 13
public BehaviourDefinition<ClassBehaviourBinding> bindClassBehaviour(QName policy, QName classRef, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Class Reference", classRef);
    ParameterCheck.mandatory("Behaviour", behaviour);

    // Validate Binding
    ClassDefinition classDefinition = dictionary.getClass(classRef);
    if (classDefinition == null)
    {
        throw new IllegalArgumentException("Class " + classRef + " has not been defined in the data dictionary");
    }
    
    // Create behaviour definition and bind to policy
    ClassBehaviourBinding binding = new ClassBehaviourBinding(dictionary, classRef);
    BehaviourDefinition<ClassBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Class, policy, binding, behaviour);
    getClassBehaviourIndex(policy).putClassBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to policy " + policy + " for class " + classRef);

    return definition;
}
 
Example 14
public BehaviourDefinition<ServiceBehaviourBinding> bindClassBehaviour(QName policy, Object service, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Service", service);
    ParameterCheck.mandatory("Behaviour", behaviour);
    
    // Create behaviour definition and bind to policy
    ServiceBehaviourBinding binding = new ServiceBehaviourBinding(service);
    BehaviourDefinition<ServiceBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Class, policy, binding, behaviour);
    getClassBehaviourIndex(policy).putServiceBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to policy " + policy + " for service " + service);

    return definition;
}
 
Example 15
public void addAclMembersToAcl(long aclId, List<Pair<Long, Integer>> aceIdsWithDepths)
{
    ParameterCheck.mandatory("aceIdsWithDepths", aceIdsWithDepths);
    
    List<AclMemberEntity> newMembers = new ArrayList<AclMemberEntity>(aceIdsWithDepths.size());
    
    for (Pair<Long,Integer> aceIdWithDepth : aceIdsWithDepths)
    {
        AclMemberEntity newMember = new AclMemberEntity();
        newMember.setAclId(aclId);
        newMember.setAceId(aceIdWithDepth.getFirst());
        newMember.setPos(aceIdWithDepth.getSecond());
        
        AclMemberEntity result = createAclMemberEntity(newMember);
        newMembers.add(result);
    }
}
 
Example 16
public BehaviourDefinition<ClassFeatureBehaviourBinding> bindPropertyBehaviour(QName policy, QName className, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Class Reference", className);
    ParameterCheck.mandatory("Behaviour", behaviour);

    // Validate Binding
    ClassDefinition classDefinition = dictionary.getClass(className);
    if (classDefinition == null)
    {
        throw new IllegalArgumentException("Class " + className + " has not been defined in the data dictionary");
    }
    
    // Create behaviour definition and bind to policy
    ClassFeatureBehaviourBinding binding = new ClassFeatureBehaviourBinding(dictionary, className, FEATURE_WILDCARD);
    BehaviourDefinition<ClassFeatureBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Property, policy, binding, behaviour);
    getPropertyBehaviourIndex(policy).putClassBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to policy " + policy + " for property " + FEATURE_WILDCARD + " of class " + className);

    return definition;
}
 
Example 17
public BehaviourDefinition<ServiceBehaviourBinding> bindPropertyBehaviour(QName policy, Object service, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Service", service);
    ParameterCheck.mandatory("Behaviour", behaviour);
    
    // Create behaviour definition and bind to policy
    ServiceBehaviourBinding binding = new ServiceBehaviourBinding(service);
    BehaviourDefinition<ServiceBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Property, policy, binding, behaviour);
    getPropertyBehaviourIndex(policy).putServiceBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to property policy " + policy + " for service " + service);

    return definition;
}
 
Example 18
/**
 * {@inheritDoc}
 */
public PagingResults<String> getAuthorities(AuthorityType type, String zoneName, String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, PagingRequest pagingRequest)
{
    ParameterCheck.mandatory("pagingRequest", pagingRequest);
    
    if ((type == null) && (zoneName == null))
    {
        throw new IllegalArgumentException("Type and/or zoneName required - both cannot be null");
    }
    if (type != null)
    {
        switch (type)
        {
        case USER:
        case GROUP:
        case ROLE:
            return authorityDAO.getAuthorities(type, zoneName, displayNameFilter, sortByDisplayName, sortAscending, pagingRequest);
        case ADMIN:
        case EVERYONE:
        case GUEST:
        case OWNER:
        default:
             // others
             return getOtherAuthorities(type); // either singletons or empty - hence ignore zone/filter/sort/paging
        }
    }
    
    // type is null
    return authorityDAO.getAuthorities(type, zoneName, displayNameFilter, sortByDisplayName, sortAscending, pagingRequest);
}
 
Example 19
/**
 * Gets whether the Person has configured Presence parameters
 * 
 * @param person       the person to query
 * 
 * @return true if this person is configured for presence
 */
public boolean hasPresence(ScriptNode person)
{
    ParameterCheck.mandatory("Person", person);
    String presenceProvider = (String)person.getProperties().get(ContentModel.PROP_PRESENCEPROVIDER);
    String presenceUsername = (String)person.getProperties().get(ContentModel.PROP_PRESENCEUSERNAME);

    return (!"".equals((presenceProvider)) && (!"".equals(presenceUsername)));
}
 
Example 20
/**
 * Set the site visibility
 * 
 * @param visibility    site visibility (public|moderated|private)
 */
public void setVisibility(String visibility)
{
    ParameterCheck.mandatoryString("visibility", visibility);
    SiteVisibility siteVisibility = SiteVisibility.valueOf(visibility);
    this.siteInfo.setVisibility(siteVisibility);
    this.isDirty = true;
}
 
Example 21
/**
 * Perform import via Content Handler
 * 
 * @param nodeRef node reference to import under
 * @param location the location to import under
 * @param handler the import content handler
 * @param binding import configuration
 * @param progress import progress
 * @return  content handler to interact with
 */
public ContentHandler handlerImport(NodeRef nodeRef, Location location, ImportContentHandler handler, ImporterBinding binding, ImporterProgress progress)
{
    ParameterCheck.mandatory("Node Reference", nodeRef);

    DefaultContentHandler defaultHandler = new DefaultContentHandler(handler);
    ImportPackageHandler streamHandler = new ContentHandlerStreamHandler(defaultHandler);
    Importer nodeImporter = new NodeImporter(nodeRef, location, binding, streamHandler, progress);
    defaultHandler.setImporter(nodeImporter);
    return defaultHandler;        
}
 
Example 22
public Association(ServiceRegistry services, AssociationRef assocRef, Scriptable scope)
{
	ParameterCheck.mandatory("Service registry", services);
	ParameterCheck.mandatory("Association reference", assocRef);		
	this.services = services;
	this.assocRef = assocRef;
	if (scope != null)
	{
		this.scope = scope;
	}
}
 
Example 23
/**
 * Set a password for the given user. Note that only an administrator
 * can perform this action, otherwise it will be ignored.
 * 
 * @param userName          Username to change password for
 * @param password          Password to set
 */
public void setPassword(String userName, String password)
{
    ParameterCheck.mandatoryString("userName", userName);
    ParameterCheck.mandatoryString("password", password);
    
    MutableAuthenticationService authService = this.services.getAuthenticationService();
    if (this.authorityService.hasAdminAuthority() && (userName.equalsIgnoreCase(authService.getCurrentUserName()) == false))
    {
        authService.setAuthentication(userName, password.toCharArray());
    }
}
 
Example 24
public void postActivity(String activityType, String siteId, String appTool, NodeRef nodeRef, String name)
{
    ParameterCheck.mandatory("nodeRef", nodeRef);
    
    StringBuffer sb = new StringBuffer();
    sb.append("{").append("\""+PostLookup.JSON_NODEREF_LOOKUP+"\":\"").append(nodeRef.toString()).append("\"").append(",")
                  .append("\"name\":\"").append(name).append("\"")
                  .append("}");
    
    postActivity(activityType, siteId, appTool, sb.toString(), ActivityPostEntity.STATUS.PENDING, getCurrentUser(),null,null);
}
 
Example 25
public PagingResults<ActivityFeedEntity> getPagedUserFeedEntries(String feedUserId, String siteId, boolean excludeThisUser, boolean excludeOtherUsers, long minFeedId, PagingRequest pagingRequest)
{
    try
    {
        // NOTE: siteId is optional
        ParameterCheck.mandatoryString("feedUserId", feedUserId);
        
        if(!userNamesAreCaseSensitive)
        {
            feedUserId = feedUserId.toLowerCase();
        }

        String currentUser = getCurrentUser();
        if (! ((currentUser == null) || 
               (authorityService.isAdminAuthority(currentUser)) ||
               (currentUser.equals(feedUserId)) ||
               (AuthenticationUtil.getSystemUserName().equals(this.tenantService.getBaseNameUser(currentUser)))))
        {
            throw new AccessDeniedException("Unable to get user feed entries for '" + feedUserId + "' - currently logged in as '" + currentUser +"'");
        }
        
        if (siteId != null)
        {
            siteId = tenantService.getName(siteId);
        }

        String networkId = tenantService.getCurrentUserDomain();

        PagingResults<ActivityFeedEntity> activityFeedEntries = feedDAO.selectPagedUserFeedEntries(feedUserId, networkId, siteId, excludeThisUser, excludeOtherUsers, minFeedId, pagingRequest);
        return activityFeedEntries;
    }
    catch (SQLException se)
    {
        AlfrescoRuntimeException are = new AlfrescoRuntimeException("Unable to get user feed entries: " + se.getMessage());
        logger.error(are);
        throw are;
    }
}
 
Example 26
public void updateAcl(AclUpdateEntity entity)
{
    ParameterCheck.mandatory("entity", entity);
    ParameterCheck.mandatory("entity.id", entity.getId());
    ParameterCheck.mandatory("entity.aclVersion", entity.getAclVersion());
    ParameterCheck.mandatory("entity.version", entity.getVersion());
    
    int updated = aclEntityCache.updateValue(entity.getId(), entity);
    if (updated < 1)
    {
        aclEntityCache.removeByKey(entity.getId());
        throw new ConcurrencyFailureException("AclEntity with ID (" + entity.getId() + ") no longer exists or has been updated concurrently");
    }
}
 
Example 27
public void unsetFeedControl(FeedControl feedControl)
{
    ParameterCheck.mandatory("feedControl", feedControl);
    
    String userId = getCurrentUser();
    
    if (userId == null)
    {
        throw new AlfrescoRuntimeException("Current user " + userId + " is not permitted to unset feed control");
    }
    
    try
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("Deleting feed control for siteId: " + feedControl.getSiteId() + ",\n appToolId : " + feedControl.getAppToolId() + ",\n for user : " + userId);
        }
        // MNT-9104 If username contains uppercase letters the action of joining a site will not be displayed in "My activities"
        if (!userNamesAreCaseSensitive)
        {
            userId = userId.toLowerCase();
        }

        feedControlDAO.deleteFeedControl(new FeedControlEntity(userId, feedControl));
    }
    catch (SQLException e) 
    {
        AlfrescoRuntimeException are = new AlfrescoRuntimeException("Failed to unset feed control: " + e, e);
        logger.error(are);
        throw are;
    }
}
 
Example 28
/**
 * Construct
 * 
 * @param nodeRefs NodeRef[]
 */
public Location(NodeRef[] nodeRefs)
{
    ParameterCheck.mandatory("Node Refs", nodeRefs);
    this.storeRef = nodeRefs[0].getStoreRef();
    this.nodeRefs = nodeRefs;
}
 
Example 29
public void renamePermission(QName oldTypeQName, String oldName, QName newTypeQName, String newName)
{
    ParameterCheck.mandatory("oldTypeQName", oldTypeQName);
    ParameterCheck.mandatory("oldName", oldName);
    ParameterCheck.mandatory("newTypeQName", newTypeQName);
    ParameterCheck.mandatory("newName", newName);
    
    if (oldTypeQName.equals(newTypeQName) && oldName.equals(newName))
    {
        throw new IllegalArgumentException("Cannot move permission to itself: " + oldTypeQName + "-" + oldName);
    }
    
    SimplePermissionReference oldPermRef = SimplePermissionReference.getPermissionReference(oldTypeQName, oldName);
    PermissionEntity permission = getPermissionForUpdate(oldPermRef);
    if (permission != null)
    {
        Long newTypeQNameId = qnameDAO.getOrCreateQName(newTypeQName).getFirst();
        permission.setTypeQNameId(newTypeQNameId);
        permission.setName(newName);
        
        int updated = permissionEntityCache.updateValue(permission.getId(), permission);
        if (updated < 1)
        {
            aclEntityCache.removeByKey(permission.getId());
            throw new ConcurrencyFailureException("PermissionEntity with ID (" + permission.getId() + ") no longer exists or has been updated concurrently");
        }
    }
}
 
Example 30
public RepositoryExportHandle[] export(NodeRef repositoryDestination, String packageName)
{
    ParameterCheck.mandatory("repositoryDestination", repositoryDestination);
    FileInfo destInfo = fileFolderService.getFileInfo(repositoryDestination);
    if (destInfo == null || !destInfo.isFolder())
    {
        throw new ExporterException("Repository destination " + repositoryDestination + " is not a folder.");
    }

    List<FileExportHandle> exportHandles = exportStores(exportStores, packageName, new TempFileExporter());
    Map<String, String> mimetypeExtensions = mimetypeService.getExtensionsByMimetype();
    List<RepositoryExportHandle> repoExportHandles = new ArrayList<RepositoryExportHandle>(exportHandles.size());
    for (FileExportHandle exportHandle : exportHandles)
    {
        String name = exportHandle.packageName + "." + mimetypeExtensions.get(exportHandle.mimeType);
        String title = exportHandle.packageName;
        String description;
        if (exportHandle.storeRef != null)
        {
            description = I18NUtil.getMessage("export.store.package.description", new Object[] { exportHandle.storeRef.toString() });
        }
        else
        {
            description = I18NUtil.getMessage("export.generic.package.description");
        }
        
        NodeRef repoExportFile = addExportFile(repositoryDestination, name, title, description, exportHandle.mimeType, exportHandle.exportFile);
        RepositoryExportHandle handle = new RepositoryExportHandle();
        handle.storeRef = exportHandle.storeRef;
        handle.packageName = exportHandle.packageName;
        handle.mimeType = exportHandle.mimeType;
        handle.exportFile = repoExportFile;
        repoExportHandles.add(handle);
        
        // delete temporary export file
        exportHandle.exportFile.delete();
    }
    
    return repoExportHandles.toArray(new RepositoryExportHandle[repoExportHandles.size()]);
}