diff options
author | Benoit Lamarche <benoitlamarche@google.com> | 2015-02-10 16:11:49 +0100 |
---|---|---|
committer | Benoit Lamarche <benoitlamarche@google.com> | 2015-02-10 16:45:25 +0100 |
commit | 26b0ced7b82a661aff3fc4f5c771dadcf9f1769e (patch) | |
tree | c1f8eec1398ad4e79ea867440a6b1dd6e6053deb /sched | |
parent | 83b7ed4501ff36c08104a0848fdcb7712905b8de (diff) | |
download | toolchain_jack-26b0ced7b82a661aff3fc4f5c771dadcf9f1769e.tar.gz toolchain_jack-26b0ced7b82a661aff3fc4f5c771dadcf9f1769e.tar.bz2 toolchain_jack-26b0ced7b82a661aff3fc4f5c771dadcf9f1769e.zip |
Use new VFS everywhere
Change-Id: Iedd0b9743c20ccc0a8e5d270c4743b109c793f31
Diffstat (limited to 'sched')
3 files changed, 19 insertions, 14 deletions
diff --git a/sched/src/com/android/sched/util/codec/DirectDirOutputVFSCodec.java b/sched/src/com/android/sched/util/codec/DirectDirOutputVFSCodec.java index 56d778cc..5ddffe0b 100644 --- a/sched/src/com/android/sched/util/codec/DirectDirOutputVFSCodec.java +++ b/sched/src/com/android/sched/util/codec/DirectDirOutputVFSCodec.java @@ -18,7 +18,8 @@ package com.android.sched.util.codec; import com.android.sched.util.file.Directory; import com.android.sched.util.file.FileOrDirectory.Existence; -import com.android.sched.vfs.DirectVFS; +import com.android.sched.vfs.DirectFS; +import com.android.sched.vfs.GenericOutputVFS; import com.android.sched.vfs.OutputVFS; import java.io.IOException; @@ -45,8 +46,9 @@ public class DirectDirOutputVFSCodec extends OutputVFSCodec { public OutputVFS checkString(@Nonnull CodecContext context, @Nonnull final String string) throws ParsingException { try { - return new DirectVFS( - new Directory(string, context.getRunnableHooks(), existence, permissions, change)); + return new GenericOutputVFS(new DirectFS( + new Directory(string, context.getRunnableHooks(), existence, permissions, change), + permissions)); } catch (IOException e) { throw new ParsingException(e.getMessage(), e); } diff --git a/sched/src/com/android/sched/util/codec/InputVFSCodec.java b/sched/src/com/android/sched/util/codec/InputVFSCodec.java index e82dcb68..f0588d09 100644 --- a/sched/src/com/android/sched/util/codec/InputVFSCodec.java +++ b/sched/src/com/android/sched/util/codec/InputVFSCodec.java @@ -25,9 +25,11 @@ import com.android.sched.util.file.FileOrDirectory.Existence; import com.android.sched.util.file.FileOrDirectory.Permission; import com.android.sched.util.file.InputZipFile; import com.android.sched.util.log.LoggerFactory; -import com.android.sched.vfs.DirectVFS; +import com.android.sched.vfs.DirectFS; +import com.android.sched.vfs.GenericInputVFS; import com.android.sched.vfs.InputVFS; -import com.android.sched.vfs.InputZipVFS; +import com.android.sched.vfs.ReadZipFS; +import com.android.sched.vfs.VFS; import java.io.File; import java.io.IOException; @@ -74,19 +76,19 @@ public class InputVFSCodec extends FileOrDirCodec @Nonnull public InputVFS checkString(@Nonnull CodecContext context, @Nonnull final String string) throws ParsingException { - final InputVFS vfs; + final VFS vfs; try { File dirOrZip = new File(string); if (dirOrZip.isDirectory()) { - vfs = new DirectVFS(new Directory(string, context.getRunnableHooks(), - Existence.MUST_EXIST, Permission.READ, change)); + vfs = new DirectFS(new Directory(string, context.getRunnableHooks(), + Existence.MUST_EXIST, Permission.READ, change), Permission.READ); } else { RunnableHooks hooks = context.getRunnableHooks(); assert hooks != null; - vfs = new InputZipVFS(new InputZipFile(string, hooks, Existence.MUST_EXIST, change)); + vfs = new ReadZipFS(new InputZipFile(string, hooks, Existence.MUST_EXIST, change)); } - return vfs; + return new GenericInputVFS(vfs); } catch (IOException e) { throw new ParsingException(e.getMessage(), e); } diff --git a/sched/src/com/android/sched/util/codec/ZipOutputVFSCodec.java b/sched/src/com/android/sched/util/codec/ZipOutputVFSCodec.java index 812c3aed..162917ea 100644 --- a/sched/src/com/android/sched/util/codec/ZipOutputVFSCodec.java +++ b/sched/src/com/android/sched/util/codec/ZipOutputVFSCodec.java @@ -20,8 +20,9 @@ import com.android.sched.util.RunnableHooks; import com.android.sched.util.file.FileOrDirectory.Existence; import com.android.sched.util.file.OutputZipFile; import com.android.sched.util.log.LoggerFactory; +import com.android.sched.vfs.GenericOutputVFS; import com.android.sched.vfs.OutputVFS; -import com.android.sched.vfs.OutputZipVFS; +import com.android.sched.vfs.WriteZipFS; import java.io.IOException; import java.util.logging.Logger; @@ -53,9 +54,9 @@ public class ZipOutputVFSCodec extends OutputVFSCodec { @Nonnull final String string) throws ParsingException { RunnableHooks hooks = context.getRunnableHooks(); try { - final OutputZipVFS vfs = - new OutputZipVFS(new OutputZipFile(string, hooks, existence, change)); - return vfs; + WriteZipFS vfs = + new WriteZipFS(new OutputZipFile(string, hooks, existence, change)); + return new GenericOutputVFS(vfs); } catch (IOException e) { throw new ParsingException(e.getMessage(), e); } |