Examples of UriHandler


Examples of org.apache.oozie.dependency.URIHandler

    protected boolean pathExists(String sPath, Configuration actionConf, String user) throws IOException {
        LOG.debug("checking for the file " + sPath);
        try {
            URI uri = new URI(sPath);
            URIHandlerService service = Services.get().get(URIHandlerService.class);
            URIHandler handler = service.getURIHandler(uri);
            return handler.exists(uri, actionConf, user);
        }
        catch (URIHandlerException e) {
            coordAction.setErrorCode(e.getErrorCode().toString());
            coordAction.setErrorMessage(e.getMessage());
            if (e.getCause() != null && e.getCause() instanceof AccessControlException) {
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

            revisionDescriptor =
                new NodeRevisionDescriptor(0);
        }
       
        // check destination URI
        UriHandler destinationUriHandler = UriHandler.getUriHandler(colName);
        if (destinationUriHandler.isRestrictedUri()) {
            int statusCode = WebdavStatus.SC_FORBIDDEN;
            sendError( statusCode, getClass().getName()+".restrictedDestinationUri", new Object[]{colName} );
            throw new WebdavException( statusCode );
        }
       
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

                    }
                }
            }
           
            // check precondition DAV:cannot-modify-version
            UriHandler uriHandler = UriHandler.getUriHandler(resourcePath);
            if (uriHandler.isVersionUri()) {
                return new ViolatedPrecondition(C_CANNOT_MODIFY_VERSION,
                                                WebdavStatus.SC_FORBIDDEN);
            }
        }
       
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

        resp.addHeader("MS-Author-Via", "DAV");
       
        // build response body if needed
        if( responseBodyNeeded ) {
            resp.setContentType( TEXT_XML_UTF_8 );
            UriHandler uh = UriHandler.getUriHandler( resourceUri );
            String storeName = uh.getAssociatedBaseStoreName(token.getName());
            UriHandler hpath = HistoryPathHandler.getHistoryPathHandler();
            UriHandler wspath = WorkspacePathHandler.getWorkspacePathHandler();
            Element ore =
                new Element( E_OPTIONS_RESPONSE, DNSP );
            if( versionHistoryCollectionSetRequested ) {
                Element vhcse =
                    new Element( E_VERSION_HISTORY_COLLECTION_SET, DNSP );
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
       
        // check destination URI
        UriHandler destUh = UriHandler.getUriHandler(destinationUri);
        if( VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH != null && VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH.length() > 0 ) {
            UriHandler exUh = UriHandler.getUriHandler( VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH );
            if( exUh.isAncestorOf(destUh) )
                isInVersioncontrolExcludePath = true;
        }
       
        if (destUh.isRestrictedUri()) {
            boolean sendError = true;
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

     *                             MacroDeleteException.
     */
    public void beforeCopy(String sourceUri, String destinationUri, boolean isRootOfCopy) throws SlideException {
        if(Configuration.useVersionControl()) {
           
            UriHandler sourceUh = UriHandler.getUriHandler(sourceUri);
            if (sourceUh.isHistoryUri()) {
                throw new PreconditionViolationException(
                    new ViolatedPrecondition(DeltavConstants.C_CANNOT_COPY_HISTORY, WebdavStatus.SC_FORBIDDEN), sourceUri);
            }
           
            if (!macroParameters.isDeleteCreate()) {
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

                                                                                          WebdavStatus.SC_FORBIDDEN), destinationUri);
                    }
                }
               
                // check precondition DAV:cannot-modify-version
                UriHandler uriHandler = UriHandler.getUriHandler(destinationUri);
                if (uriHandler.isVersionUri()) {
                    throw new PreconditionViolationException(new ViolatedPrecondition(C_CANNOT_MODIFY_VERSION,
                                                                                      WebdavStatus.SC_FORBIDDEN), destinationUri);
                }
               
                // checkout if necessary
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

        } else {
            macroParameters = Macro.DEFAULT_PARAMETERS;
        }

        // check destination URI
        UriHandler destinationUriHandler = UriHandler.getUriHandler(destinationUri);
        if (destinationUriHandler.isRestrictedUri()) {
            int statusCode = WebdavStatus.SC_FORBIDDEN;
            sendError( statusCode, getClass().getName()+".restrictedDestinationUri", new Object[]{destinationUri} );
            throw new WebdavException( statusCode );
        }

        UriHandler sourceUriHandler = UriHandler.getUriHandler(sourceUri);
        isRequestSourceWorkspace = sourceUriHandler.isWorkspaceUri();

        try {
            // check preconditions
            ViolatedPrecondition violatedPrecondition = getPreconditionViolation(sourceUri, destinationUri);
            if (violatedPrecondition != null) {
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

        ViolatedPrecondition violatedPrecondition = null;
        if( Configuration.useVersionControl() ) {

            if (isRequestSourceWorkspace) {

                UriHandler destinationUriHandler = UriHandler.getUriHandler(destinationUri);
                NodeRevisionDescriptors destinationRevisionDescriptors = null;
                NodeRevisionDescriptor destinationRevisionDescriptor = null;
                try {
                    destinationRevisionDescriptors = content.retrieve( stoken, destinationUri);
                    destinationRevisionDescriptor = content.retrieve( stoken, destinationRevisionDescriptors);
                }
                catch( ObjectNotFoundException e ) {}; // can be ignored here!

                ResourceKind destinationResourceKind =
                    AbstractResourceKind.determineResourceKind( token, destinationUri, destinationRevisionDescriptor );

                if( !(destinationResourceKind instanceof DeltavCompliantUnmappedUrl) ) {
                    return new ViolatedPrecondition(C_RESOURCE_MUST_BE_NULL,
                                                    WebdavStatus.SC_CONFLICT);
                }
                if( !destinationUriHandler.isWorkspaceUri() ) {
                    return new ViolatedPrecondition(C_WORKSPACE_LOCATION_OK,
                                                    WebdavStatus.SC_CONFLICT);
                }
            }
        }
        if (isCollection(sourceUri)) {
            UriHandler destinationUriHandler = UriHandler.getUriHandler(destinationUri);
            ObjectNode destinationParentNode =
                structure.retrieve(stoken, destinationUriHandler.getParentUriHandler().toString());
            ObjectNode sourceNode =
                structure.retrieve(stoken, sourceUri);
            if (isDescendant(destinationParentNode, sourceNode)) {
                return new ViolatedPrecondition(C_CYCLE_ALLOWED, WebdavStatus.SC_FORBIDDEN);
            }
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

     */
    public void beforeCopy(String sourceUri, String destinationUri, boolean isRootOfCopy) throws SlideException {

        if( Configuration.useVersionControl() ) {

            UriHandler uriHandler = UriHandler.getUriHandler(sourceUri);
            if (uriHandler.isVersionUri()) {
                throw new PreconditionViolationException(new ViolatedPrecondition(DeltavConstants.C_CANNOT_RENAME_VERSION,
                                                                                  WebdavStatus.SC_FORBIDDEN),
                                                         sourceUri);
            }
            if (uriHandler.isHistoryUri()) {
                throw new PreconditionViolationException(new ViolatedPrecondition(DeltavConstants.C_CANNOT_RENAME_HISTORY,
                                                                                  WebdavStatus.SC_FORBIDDEN),
                                                         sourceUri);
            }
            if (uriHandler.isWorkingresourceUri()) {
                throw new PreconditionViolationException(new ViolatedPrecondition(DeltavConstants.C_CANNOT_RENAME_WORKING_RESOURCE,
                                                                                  WebdavStatus.SC_FORBIDDEN),
                                                         sourceUri);
            }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.