aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2018-06-21 18:57:26 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-21 18:59:08 -0700
commitbda12a1b239235de0169b14760214e43f839bed8 (patch)
treead47596f2e0d52dbaf7faf1fb7239145cbaa8b8f /src/main/java/com/google/devtools/build/lib/runtime
parenta8d7357b7dc66e0531c298e4d369e6342fcf94b7 (diff)
Move HashFunction out of FileSystem, and turn it into a class, instead of an enum.
Now that we aren't using enum names for the hash functions, we also accept the standard names, such as SHA-256. RELNOTES: None. PiperOrigin-RevId: 201624286
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java b/src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java
index e6576238ca..a734424a03 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java
@@ -17,8 +17,9 @@ import com.google.devtools.build.lib.unix.UnixFileSystem;
import com.google.devtools.build.lib.util.AbruptExitException;
import com.google.devtools.build.lib.util.ExitCode;
import com.google.devtools.build.lib.util.OS;
+import com.google.devtools.build.lib.vfs.DigestHashFunction;
+import com.google.devtools.build.lib.vfs.DigestHashFunction.DigestFunctionConverter;
import com.google.devtools.build.lib.vfs.FileSystem;
-import com.google.devtools.build.lib.vfs.FileSystem.HashFunction;
import com.google.devtools.build.lib.vfs.JavaIoFileSystem;
import com.google.devtools.build.lib.windows.WindowsFileSystem;
import com.google.devtools.common.options.OptionsParsingException;
@@ -34,11 +35,11 @@ public class BazelFileSystemModule extends BlazeModule {
@Override
public FileSystem getFileSystem(OptionsProvider startupOptions) throws AbruptExitException {
- final HashFunction hashFunction;
+ final DigestHashFunction hashFunction;
String value = null;
try {
value = System.getProperty("bazel.DigestFunction", "SHA256");
- hashFunction = new HashFunction.Converter().convert(value);
+ hashFunction = new DigestFunctionConverter().convert(value);
} catch (OptionsParsingException e) {
throw new AbruptExitException(
"The specified hash function '" + value + "' is not supported.",