Package org.jets3t.service.utils

Examples of org.jets3t.service.utils.FileComparerResults


     */
    public void restoreToLocalDirectory(Map<String, String> objectKeyToFilepathMap,
        String rootObjectPath, File localDirectory, StorageBucket bucket,
        BytesProgressWatcher md5GenerationProgressWatcher) throws Exception
    {
        FileComparerResults mergedDiscrepancyResults = new FileComparerResults();

        String priorLastKey = null;

        // Store local path mapped to storage object for moved objects.
        Map<String, StorageObject> objectsMoved = new HashMap<String, StorageObject>();

        // Repeat download actions until all objects in bucket have been listed.
        do {
            ComparisonResult result =
                compareLocalAndRemoteFiles(mergedDiscrepancyResults, bucket.getName(),
                    rootObjectPath, priorLastKey, objectKeyToFilepathMap,
                    md5GenerationProgressWatcher);
            priorLastKey = result.priorLastKey;
            FileComparerResults discrepancyResults = result.discrepancyResults;
            Map<String, StorageObject> objectsMap = result.objectsMap;

            // Download objects to local files/directories.
            Iterator<String> objectKeyIter = objectsMap.keySet().iterator();

View Full Code Here


                            int progressValue = (int)((double)getBytesTransferred() * 100 / getBytesToTransfer());
                            updateProgressDialog(statusText, detailsText, progressValue);
                        }
                    };

                    FileComparerResults comparisonResults = FileComparer.getInstance()
                        .buildDiscrepancyLists(objectKeyToFilepathMap, s3ObjectsMap, progressWatcher);

                    stopProgressDialog();

                    if (upload) {
View Full Code Here

                service, bucket.getName(), "", objectKeyToFilepathMap, false, false, null, null);
            assertEquals(5, objectMap.size());
            assertTrue(objectMap.keySet().contains(local3Path));

            // Compare local and remote objects -- should be identical
            FileComparerResults comparerResults =
                comparer.buildDiscrepancyLists(objectKeyToFilepathMap, objectMap);
            assertEquals(5, comparerResults.alreadySynchronisedKeys.size());
            assertEquals(0, comparerResults.onlyOnClientKeys.size());
            assertEquals(0, comparerResults.onlyOnServerKeys.size());
            assertEquals(0, comparerResults.updatedOnClientKeys.size());
View Full Code Here

TOP

Related Classes of org.jets3t.service.utils.FileComparerResults

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.