Package org.apache.xindice.webadmin

Examples of org.apache.xindice.webadmin.Location


     * @return map containing status for a path
     * @throws DBException
     */
    public static Map copy(Collection col, String dest, boolean overwrite, boolean deep) throws DBException {

        Location destLocation = new Location(dest);
        Collection destCollection = destLocation.getCollection();
        String destName = destLocation.getName();
        Map results = new HashMap();

        if (destLocation.isRoot()) {
            results.put(dest, new Integer(WebdavStatus.SC_BAD_REQUEST));
            return results;
        } else if (destCollection == null) {
            // either intermidiate collection does not exist or destination points to
            // the first level collection (database).
View Full Code Here


     * @return status
     * @throws DBException
     */
    public static int copy(Collection col, String name, String dest, boolean overwrite) throws DBException {

        Location destLocation = new Location(dest);
        Collection destCollection = destLocation.getCollection();
        String destName = destLocation.getName();

        if (destLocation.isRoot()) {
            // resource cannot be added to root directly, database has to be created manually
            return WebdavStatus.SC_FORBIDDEN;
        } else if (destCollection == null) {
            return WebdavStatus.SC_CONFLICT;
        } else if (col == destCollection && name.equals(destName)) {
View Full Code Here

            response.sendRedirect(redirect);
            return;
        }

        // get request target
        Location target;
        try {
            target = new Location(path);
        } catch (DBException e) {
            log.error("Unable to process request '" + path + "'", e);
            throw new ServletException(e);
        }

        // get viewer parameter (missing if DAV request)
        String viewer = request.getParameter("viewer");

        // WebDAV requests do not have viewer parameter, nor can not GET a collection
        if (viewer == null && !(path.endsWith("/") && method.equalsIgnoreCase("GET"))) {
            DAVComponent m = webAdmin.getMethod(method);
            if (m == null) {
                // method is not supported
                if (log.isInfoEnabled()) {
                    log.info("Method " + method + " is not supported.");
                }
                response.setStatus(WebdavStatus.SC_NOT_IMPLEMENTED);
                return;
            }

            m.execute(new DAVRequest(request), new DAVResponse(response), target);
            return;
        }

        // HTML requests are all the rest
        Collection col = target.getCollection();
        String resource = target.getName();
        if (col == null) {
            // redirect if path is not '/'
            if (!path.equals("/")) {
                String redirect = request.getContextPath() + request.getServletPath() + "/?viewer=" + viewer;
                response.sendRedirect(redirect);
View Full Code Here

TOP

Related Classes of org.apache.xindice.webadmin.Location

Copyright © 2018 www.massapicom. 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.