Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
Lots of JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
binwiederhier committed Jul 18, 2014
1 parent ef80716 commit c9b66ae
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 8 deletions.
10 changes: 10 additions & 0 deletions syncany-lib/src/main/java/org/syncany/config/to/UserConfigTO.java
Expand Up @@ -27,6 +27,16 @@
import org.simpleframework.xml.core.Persister;
import org.syncany.config.ConfigException;

/**
* The user config transfer object is a helper data structure that allows storing
* a user's global system settings such as system properties.
*
* <p>It uses the Simple framework for XML serialization, and its corresponding
* annotation-based configuration.
*
* @see <a href="http://simple.sourceforge.net/">Simple framework</a> at simple.sourceforge.net
* @author Philipp C. Heckel <philipp.heckel@gmail.com>
*/
@Root(name="userConfig")
@Namespace(reference="http://syncany.org/userconfig/1")
public class UserConfigTO {
Expand Down
Expand Up @@ -18,7 +18,9 @@
package org.syncany.crypto;

/**
*
* Exception thrown when content cannot encrypted or decrypted,
* or other cryptographic operations fail.
*
* @author Philipp C. Heckel <philipp.heckel@gmail.com>
*/
public class CipherException extends Exception {
Expand Down
15 changes: 15 additions & 0 deletions syncany-lib/src/main/java/org/syncany/operations/Assembler.java
Expand Up @@ -25,6 +25,7 @@
import java.util.logging.Logger;

import org.apache.commons.io.IOUtils;
import org.syncany.chunk.Deduper;
import org.syncany.chunk.MultiChunk;
import org.syncany.chunk.MultiChunker;
import org.syncany.config.Config;
Expand All @@ -35,6 +36,16 @@
import org.syncany.database.MultiChunkEntry.MultiChunkId;
import org.syncany.database.SqlDatabase;

/**
* The assembler re-assembles files broken down through the deduplication
* mechanisms of the {@link Deduper} and its corresponding classes (chunker,
* multichunker, etc.).
*
* <p>It uses the local {@link SqlDatabase} and an optional {@link MemoryDatabase}
* to perform file checksum and chunk checksum lookups.
*
* @author Philipp C. Heckel <philipp.heckel@gmail.com>
*/
public class Assembler {
private static final Logger logger = Logger.getLogger(Assembler.class.getSimpleName());

Expand All @@ -52,6 +63,10 @@ public Assembler(Config config, SqlDatabase localDatabase, MemoryDatabase memory
this.memoryDatabase = memoryDatabase;
}

/**
* Assembles the given file version to the local cache and returns a reference
* to the cached file after successfully assembling the file.
*/
public File assembleToCache(FileVersion fileVersion) throws Exception {
File reconstructedFileInCache = config.getCache().createTempFile("reconstructedFileVersion");
logger.log(Level.INFO, " - Creating file " + fileVersion.getPath() + " to " + reconstructedFileInCache + " ...");
Expand Down
Expand Up @@ -35,8 +35,10 @@
import org.syncany.plugins.transfer.files.MultiChunkRemoteFile;

/**
* @author pheckel
*
* The downloader uses a {@link TransferManager} to download a given set of multichunks,
* decrypt them and store them in the local cache folder.
*
* @author Philipp C. Heckel <philipp.heckel@gmail.com>
*/
public class Downloader {
private static final Logger logger = Logger.getLogger(Downloader.class.getSimpleName());
Expand Down
Expand Up @@ -33,14 +33,14 @@
*/
public abstract class AbstractTransferManager implements TransferManager {
private static final Logger logger = Logger.getLogger(AbstractTransferManager.class.getSimpleName());
private TransferSettings connection;
private TransferSettings settings;

public AbstractTransferManager(TransferSettings connection) {
this.connection = connection;
public AbstractTransferManager(TransferSettings settings) {
this.settings = settings;
}

public TransferSettings getConnection() {
return connection;
return settings;
}

// TODO [low] This should be in AbstractTransferManager (or any other central place), this should use the Syncany cache folder
Expand Down
Expand Up @@ -18,16 +18,35 @@
package org.syncany.plugins.transfer;

import org.syncany.plugins.Plugin;
import org.syncany.plugins.transfer.files.RemoteFile;

/**
* The transfer plugin is a special plugin responsible for transferring files
* to the remote storage. Implementations must provide implementations for
* {@link TransferPlugin} (this class), {@link TransferSettings} (connection
* details) and {@link TransferManager} (transfer methods).
*
* @author Philipp C. Heckel <philipp.heckel@gmail.com>
*/
public abstract class TransferPlugin extends Plugin {
public TransferPlugin(String pluginId) {
super(pluginId);
}

/**
* Creates a plugin-specific {@link TransferSettings}
* Creates an empty plugin-specific {@link TransferSettings} object.
*
* <p>The created instance must be filled with sensible connection details
* and then initialized with the <tt>init()</tt> method.
*/
public abstract TransferSettings createSettings();

/**
* Creates an initialized {@link TransferManager} object using the given
* connection details.
*
* <p>The created instance can be used to upload/download/delete {@link RemoteFile}s
* and query the remote storage for a file list.
*/
public abstract TransferManager createTransferManager(TransferSettings connection);
}

0 comments on commit c9b66ae

Please sign in to comment.