Package com.sun.xfile

Examples of com.sun.xfile.XFile


    {
        Log.out("nfs login called: " + url);

        try
        {
            XFile xf = new XFile(url);

            if(xf.exists())
            {
                Log.out("nfs url ok");
            }
            else
            {
                Log.out("WARNING: nfs url not found, cennection will fail!");
            }

            com.sun.nfs.XFileExtensionAccessor nfsx = (com.sun.nfs.XFileExtensionAccessor) xf.getExtensionAccessor();

            //Log.out("nfs extension accessor: " + nfsx);
            if(!nfsx.loginPCNFSD(host, user, pass))
            {
                Log.out("login failed!");
View Full Code Here


        return true;
    }

    public String[] getExports() throws Exception
    {
        XFile xf = new XFile(url);
        com.sun.nfs.XFileExtensionAccessor nfsx = (com.sun.nfs.XFileExtensionAccessor) xf.getExtensionAccessor();

        String[] tmp = nfsx.getExports();

        if(tmp == null)
        {
View Full Code Here

    {
        try
        {
            String tmp = toNFS(file);

            XFile f = new XFile(tmp);

            if(!f.getAbsolutePath().equals(f.getCanonicalPath()))
            {
                Log.debug("WARNING: Skipping symlink, remove failed.");
                Log.debug("This is necessary to prevent possible data loss when removing those symlinks.");

                return -1;
            }

            if(f.exists() && f.isDirectory())
            {
                cleanLocalDir(tmp);
            }

            //System.out.println(tmp);
            if(!f.delete())
            {
                return -1;
            }
            else
            {
View Full Code Here

            dir = dir + "/";
        }

        //String remoteDir = StringUtils.removeStart(dir,path);
        //System.out.println(">>> " + dir);
        XFile f2 = new XFile(dir);
        String[] tmp = f2.list();

        if(tmp == null)
        {
            return;
        }

        for(int i = 0; i < tmp.length; i++)
        {
            XFile f3 = new XFile(dir + tmp[i]);

            if(f3.isDirectory())
            {
                //System.out.println(dir);
                cleanLocalDir(dir + tmp[i]);
                f3.delete();
            }
            else
            {
                //System.out.println(dir+tmp[i]);
                f3.delete();
            }
        }
    }
View Full Code Here

                ex.printStackTrace();
            }
        }
        else
        {
            XFile f = new XFile(dir);
            files = f.list();
        }

        if(files == null)
        {
            return new String[0];
        }

        size = new String[files.length];
        perms = new int[files.length];

        int accessible = 0;

        for(int i = 0; i < files.length; i++)
        {
            XFile f2 = new XFile(dir + files[i]);

            if(f2.isDirectory() && !files[i].endsWith("/"))
            {
                files[i] = files[i] + "/";
            }

            size[i] = "" + f2.length();

            if(f2.canWrite())
            {
                accessible = FtpConnection.W;
            }
            else if(f2.canRead())
            {
                accessible = FtpConnection.R;
            }
            else
            {
View Full Code Here

            //System.out.println("downloadDir: " + dir + "," + out);
            fileCount = 0;
            shortProgress = true;
            baseFile = StringUtils.getDir(dir);

            XFile f2 = new XFile(dir);
            String[] tmp = f2.list();

            if(tmp == null)
            {
                return;
            }

            File fx = new File(out);
            fx.mkdir();

            for(int i = 0; i < tmp.length; i++)
            {
                tmp[i] = tmp[i].replace('\\', '/');

                //System.out.println("1: " + dir+tmp[i] + ", " + out +tmp[i]);
                XFile f3 = new XFile(dir + tmp[i]);

                if(f3.isDirectory())
                {
                    if(!tmp[i].endsWith("/"))
                    {
                        tmp[i] = tmp[i] + "/";
                    }
View Full Code Here

            if(tmp == null)
            {
                return;
            }

            XFile fx = new XFile(dir);
            fx.mkdir();

            for(int i = 0; i < tmp.length; i++)
            {
                tmp[i] = tmp[i].replace('\\', '/');
View Full Code Here

TOP

Related Classes of com.sun.xfile.XFile

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.