summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/backup/incremental/identifier/StorageObjectLoader.java
blob: bf5baf816c76df663638f8b9815a2dff8d8a7b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.keuin.kbackupfabric.backup.incremental.identifier;

import java.io.File;
import java.util.Objects;

public class StorageObjectLoader {
    /**
     * Get identifier from storage file.
     *
     * @param file storage file.
     * @return identifier. If failed, return null.
     */
    public static ObjectIdentifier asIdentifier(File file) {
        Objects.requireNonNull(file);
        String fileName = file.getName();
        ObjectIdentifier identifier;

        identifier = Sha256Identifier.fromFileName(fileName);
        return identifier;

        // Add more identifiers.
    }
}