summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/util/backup/incremental
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/util/backup/incremental')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java6
-rw-r--r--src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionSerializer.java3
-rw-r--r--src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/FileIdentifierProvider.java (renamed from src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/FileIdentifierFactory.java)2
-rw-r--r--src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/Sha256Identifier.java4
4 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java
index ea9edd9..ac87883 100644
--- a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java
+++ b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionFactory.java
@@ -1,6 +1,6 @@
package com.keuin.kbackupfabric.util.backup.incremental;
-import com.keuin.kbackupfabric.util.backup.incremental.identifier.FileIdentifierFactory;
+import com.keuin.kbackupfabric.util.backup.incremental.identifier.FileIdentifierProvider;
import com.keuin.kbackupfabric.util.backup.incremental.identifier.ObjectIdentifier;
import java.io.File;
@@ -17,9 +17,9 @@ import java.util.*;
*/
public class ObjectCollectionFactory <T extends ObjectIdentifier> {
- private final FileIdentifierFactory<T> identifierFactory;
+ private final FileIdentifierProvider<T> identifierFactory;
- public ObjectCollectionFactory(FileIdentifierFactory<T> identifierFactory) {
+ public ObjectCollectionFactory(FileIdentifierProvider<T> identifierFactory) {
this.identifierFactory = identifierFactory;
}
diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionSerializer.java b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionSerializer.java
index cc77837..6f9b792 100644
--- a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionSerializer.java
+++ b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/ObjectCollectionSerializer.java
@@ -3,6 +3,9 @@ package com.keuin.kbackupfabric.util.backup.incremental;
import java.io.*;
import java.util.Objects;
+/**
+ * Serialize and deserialize ObjectCollection from/to the disk file.
+ */
public class ObjectCollectionSerializer {
public static ObjectCollection fromFile(File file) throws IOException {
Objects.requireNonNull(file);
diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/FileIdentifierFactory.java b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/FileIdentifierProvider.java
index 34ad9a0..9a03371 100644
--- a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/FileIdentifierFactory.java
+++ b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/FileIdentifierProvider.java
@@ -3,6 +3,6 @@ package com.keuin.kbackupfabric.util.backup.incremental.identifier;
import java.io.File;
import java.io.IOException;
-public interface FileIdentifierFactory<T extends ObjectIdentifier> {
+public interface FileIdentifierProvider<T extends ObjectIdentifier> {
T fromFile(File file) throws IOException;
}
diff --git a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/Sha256Identifier.java b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/Sha256Identifier.java
index 9ecf2d3..cbf1bb9 100644
--- a/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/Sha256Identifier.java
+++ b/src/main/java/com/keuin/kbackupfabric/util/backup/incremental/identifier/Sha256Identifier.java
@@ -15,7 +15,7 @@ public class Sha256Identifier extends SingleHashIdentifier {
private static final int SHA256_LENGTH = 32;
private static final Sha256Identifier DUMMY = new Sha256Identifier(new byte[SHA256_LENGTH]); // only for using its hash method
- private static final FileIdentifierFactory<Sha256Identifier> factory = Sha256Identifier::fromFile;
+ private static final FileIdentifierProvider<Sha256Identifier> factory = Sha256Identifier::fromFile;
public static Sha256Identifier fromFile(File file) throws IOException {
if (!Objects.requireNonNull(file).isFile()) {
@@ -24,7 +24,7 @@ public class Sha256Identifier extends SingleHashIdentifier {
return new Sha256Identifier(DUMMY.hash(file));
}
- public static FileIdentifierFactory<Sha256Identifier> getFactory() {
+ public static FileIdentifierProvider<Sha256Identifier> getFactory() {
return factory;
}