Package com.rackspacecloud.blueflood.CloudFilesBackfiller.download

Examples of com.rackspacecloud.blueflood.CloudFilesBackfiller.download.DownloadService


        final File downloadDir = new File(config.getStringProperty(BackFillerConfig.DOWNLOAD_DIR));
        downloadDir.mkdirs();

        // connect the download service to the file manager.
        FileManager fileManager = new CloudFilesManager(USER, KEY, PROVIDER, ZONE, CONTAINER, config.getIntegerProperty(BackFillerConfig.BATCH_SIZE));
        DownloadService downloadService = new DownloadService(downloadDir);
        downloadService.setFileManager(fileManager);

        // delete any temp files before starting.
        for (File tmp : downloadDir.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.endsWith(".json.gz.tmp");
            }
        })) {
            if (!tmp.delete()) {
                log.error("Could not delete a temp file %s", tmp.getName());
                System.exit(-1);
            }
        }

        try {
            downloadService.start();
        } catch (IOException ex) {
            ex.printStackTrace();
            System.exit(-1);
        }
    }
View Full Code Here

TOP

Related Classes of com.rackspacecloud.blueflood.CloudFilesBackfiller.download.DownloadService

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.