Package com.nirima.jenkins.webdav.interfaces

Examples of com.nirima.jenkins.webdav.interfaces.IDavRepo


     */
    @Override
    public void invoke(IDavContext ctxt) throws MethodException {

        try {
            IDavRepo repo = getRepo();
            boolean created = false;

            String path = this.getPath();
            if (path.endsWith("/")) path = path.substring(0, path.length() - 1);

            IDavItem item = repo.getItem(getDavContext(), this.getPath());

            if (item == null) {
                // The item couldn't be found, so it is a creation.
                // Make the item in the parent path.
                int lastSlash = path.lastIndexOf("/");
                String parent = path.substring(0, lastSlash);
                IDavCollection parentFolder = (IDavCollection) repo.getItem(getDavContext(), parent);

                parentFolder.createCollection(getDavContext(), path.substring(lastSlash + 1));

                created = true;
            }
View Full Code Here


     * @see nrm.webdav.interfaces.IMethod#invoke()
     */
    @Override
    public void invoke(IDavContext ctxt) throws MethodException {
        try {
            IDavRepo repo = getRepo();

            IDavItem item = repo.getItem(getDavContext(), this.getPath());

            if (item != null) {
                // Remove this option for now
                item.delete(getDavContext());
            }
View Full Code Here

     * @see nrm.webdav.interfaces.IMethod#invoke()
     */
    @Override
    public void invoke(IDavContext ctxt) throws MethodException {
        try {
            IDavRepo repo = getRepo();

            IDavItem sourceItem = repo.getItem(getDavContext(), this.getPath());

            if (sourceItem != null) {
                String destination = URLDecoder.decode(this.getRequest().getHeader("Destination"), "UTF-8");
                // Can only move a file within this repository
                if (destination.startsWith(this.getBaseUrl())) {
                    // Remove the prefix (leaving leading slash)
                    destination = destination.substring(this.getBaseUrl().length());
                    // Check if there is already another file at this destination
                    IDavItem destinationItem = null;
                    try {
                        destinationItem = repo.getItem(getDavContext(), destination);
                    } catch (Exception e) {
                        // Item does not exist
                    }

                    if (destinationItem != null) {
View Full Code Here

TOP

Related Classes of com.nirima.jenkins.webdav.interfaces.IDavRepo

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.