Package ca.canucksoftware.utils

Examples of ca.canucksoftware.utils.OnlineFile


        return result;
    }

    public String getDownloadUrl() {
        String url = null;
        OnlineFile online;
        if(source!=null) {
            if(source.has("Location")) {
                try {
                    online = new OnlineFile(source.getString("Location"));
                    if(online.exists()) {
                        url = online.toString();
                    }
                } catch(Exception e) {}
            }
        }
        if((url==null) && (file!=null)) {
            online = new OnlineFile(file);
            if(online.exists()) {
                url = online.toString();
            } else {
                url = null;
            }
        }
        return url;
View Full Code Here


            }
            if(!input.endsWith("Packages") && !input.endsWith("Packages.gz")) {
                if(!input.endsWith("/")) {
                    input += "/";
                }
                if(new OnlineFile(input + "Packages.gz").exists()) {
                    input += "Packages.gz";
                } else if(new OnlineFile(input + "Packages").exists()) {
                    input += "Packages";
                }
            }
            if(new OnlineFile(input).exists()) {
                clearCustomListPref();
                customFeeds.add(input);
                tableCustom.addRow(new Object[] {input, Boolean.TRUE});
                saveCustomListPref();
                feedsChanged = true;
View Full Code Here

            if(curr instanceof String) {
                jLabel5.setText(bundle.getString("DOWNLOADING:"));
                jLabel2.setText("<html><center>" + FileUtils.getFilename((String) curr) +
                        "</center></html>");
                System.out.println("Downloading: " + ((String) curr));
                OnlineFile url = new OnlineFile((String) curr);
                currFile = url.download();
                if(currFile==null) {
                    JOptionPane.showMessageDialog(rootPane, MessageFormat.format(
                        bundle.getString("ERROR:_UNABLE_TO_DOWNLOAD_{0}"),
                        new Object[] {FileUtils.getFilename((String) curr)}));
                }
View Full Code Here

        String base = null;
        int index = url.lastIndexOf("/");
        if(index>-1) {
            base = url.substring(0, index+1);
        }
        OnlineFile online = new OnlineFile(url);
        File f = online.download();
        if(f==null) { //2nd try if 1st failed
            f = online.download();
        }
        if(base!=null && f!=null) {
            result = new PackageFeed(f, base);
        }
        return result;
View Full Code Here

TOP

Related Classes of ca.canucksoftware.utils.OnlineFile

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.