Package org.globus.util

Examples of org.globus.util.GlobusURL


        }

        final String directoryURLstr =
                this.getBaseDirectory() + "/" + ownerID + "/";
       
        final GlobusURL listdir = new GlobusURL(directoryURLstr);

        final GridFTPClient client =
                new GridFTPClient(listdir.getHost(), listdir.getPort());

        final String idauthz = this.getIdAuthz();
        if (idauthz == null) {
            client.setAuthorization(HostAuthorization.getInstance());
        } else {
            final IdentityAuthorization idA =
                    new IdentityAuthorization(idauthz);
            client.setAuthorization(idA);
        }

        client.authenticate(null);
        client.setType(Session.TYPE_ASCII);
        client.setPassive();
        client.setLocalActive();
        client.changeDir(listdir.getPath());
        final Vector v = client.mlsd(null);
        int len = v.size();
        final ArrayList files = new ArrayList(len);
        while (! v.isEmpty()) {
            final MlsxEntry f = (MlsxEntry)v.remove(0);
View Full Code Here


        }

        final UrlCopy urlcopy = new UrlCopy();

        try {
            final GlobusURL source = new GlobusURL(sourceUrlString);
            urlcopy.setSourceUrl(source);
        } catch (Exception e) {
            throw new ExecutionProblem("Problem constructing source URL: " +
                                                e.getMessage());
        }

        try {
            final GlobusURL dest = new GlobusURL(destUrlString);
            urlcopy.setDestinationUrl(dest);
        } catch (Exception e) {
            throw new ExecutionProblem("Problem constructing destination " +
                                       "URL: " + e.getMessage());
        }
View Full Code Here

        PrintStream                     debug)
            throws ExecutionProblem {
        String identityAuthorization = this.args.getGridftpID();

        String delUrlString = this.getRemoteUserBaseURLString() + vmName;
        final GlobusURL delURL;
        try {
            delURL = new GlobusURL(delUrlString);
        } catch (Exception e) {
            throw new ExecutionProblem("Problem constructing delete URL: " +
                                                e.getMessage());
        }

        final GridFTPClient ftp;
        try {
            ftp = new GridFTPClient(delURL.getHost(), delURL.getPort());
        } catch (Exception e) {
            throw new ExecutionProblem("Problem constructing GridFTPClient: " +
                                                e.getMessage());
        }

        final Authorization auth;
        if (identityAuthorization == null) {
            auth = HostAuthorization.getInstance();
            if (debug != null) {
                debug.println(
                        "Using host-based authorization of remote server");
            }
        } else {
            auth = new IdentityAuthorization(identityAuthorization);
            if (debug != null) {
                debug.println("Using identity-based authorization of remote " +
                        "server: '" + identityAuthorization + "'");
            }
        }
        ftp.setAuthorization(auth);

        PrintStream pr = null;
        if (info != null) {
            pr = info;
        } else if (debug != null) {
            pr = debug;
        }

        if (pr != null) {
            pr.println("\nDeleting: " + delUrlString);
            pr.println();
        }

        try {
            ftp.authenticate(null);
            ftp.deleteFile(delURL.getPath());
        } catch (IOException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        } catch (ServerException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }
View Full Code Here

        PrintStream                     info,
        PrintStream                     err,
        PrintStream                     debug)
               throws Exception {

        final GlobusURL listdir = new GlobusURL(url);

        if (debug != null) {
            debug.println("Listing:\n" + listdir.toString());
        }

        final GridFTPClient client =
                new GridFTPClient(listdir.getHost(), listdir.getPort());

        if (identityAuthorization == null) {
            client.setAuthorization(HostAuthorization.getInstance());
            if (debug != null) {
                debug.println(
                        "Using host-based authorization of remote server");
            }
        } else {
            final IdentityAuthorization idA =
                    new IdentityAuthorization(identityAuthorization);
            client.setAuthorization(idA);
            if (debug != null) {
                debug.println("Using identity-based authorization of remote " +
                        "server: '" + identityAuthorization + "'");
            }
        }

        if (debug != null) {
            debug.println("Authenticating.");
        }
        client.authenticate(null);
        client.setType(Session.TYPE_ASCII);
        client.setPassive();
        client.setLocalActive();

        if (debug != null) {
            debug.println("Changing directory (CWD).");
        }
        client.changeDir(listdir.getPath());

        if (debug != null) {
            debug.println("Listing.");
        }
       
View Full Code Here

TOP

Related Classes of org.globus.util.GlobusURL

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.