diff options
Diffstat (limited to 'sched')
18 files changed, 83 insertions, 0 deletions
diff --git a/sched/src/com/android/sched/util/file/InputZipFile.java b/sched/src/com/android/sched/util/file/InputZipFile.java index e8f1cc5..3fdd68b 100644 --- a/sched/src/com/android/sched/util/file/InputZipFile.java +++ b/sched/src/com/android/sched/util/file/InputZipFile.java @@ -99,4 +99,9 @@ public class InputZipFile extends StreamFile { assert file != null; return file.getName(); } + + public long getLastModified() { + assert file != null; + return file.lastModified(); + } }
\ No newline at end of file diff --git a/sched/src/com/android/sched/vfs/BaseVFS.java b/sched/src/com/android/sched/vfs/BaseVFS.java index 354cc98..935a0e5 100644 --- a/sched/src/com/android/sched/vfs/BaseVFS.java +++ b/sched/src/com/android/sched/vfs/BaseVFS.java @@ -85,6 +85,8 @@ abstract class BaseVFS<DIR extends BaseVDir, FILE extends BaseVFile> implements @Nonnull abstract VPath getPathFromRoot(@Nonnull FILE file); + abstract long getLastModified(@Nonnull FILE file); + // // Location related // diff --git a/sched/src/com/android/sched/vfs/BaseVFile.java b/sched/src/com/android/sched/vfs/BaseVFile.java index c231341..896a556 100644 --- a/sched/src/com/android/sched/vfs/BaseVFile.java +++ b/sched/src/com/android/sched/vfs/BaseVFile.java @@ -72,6 +72,11 @@ abstract class BaseVFile extends BaseVElement implements VFile { } @Override + public long getLastModified() { + return vfs.getLastModified(this); + } + + @Override public void delete() throws CannotDeleteFileException { vfs.delete(this); } diff --git a/sched/src/com/android/sched/vfs/CachedDirectFS.java b/sched/src/com/android/sched/vfs/CachedDirectFS.java index ce1f605..19affc3 100644 --- a/sched/src/com/android/sched/vfs/CachedDirectFS.java +++ b/sched/src/com/android/sched/vfs/CachedDirectFS.java @@ -366,6 +366,11 @@ public class CachedDirectFS extends BaseVFS<CachedParentVDir, CachedParentVFile> } @Override + public long getLastModified(@Nonnull CachedParentVFile file) { + return getNativeFile(file.getPath()).lastModified(); + } + + @Override @Nonnull FileLocation getVFileLocation(@Nonnull CachedParentVFile file) { return new FileLocation(getNativeFile(file.getPath())); diff --git a/sched/src/com/android/sched/vfs/CaseInsensitiveFS.java b/sched/src/com/android/sched/vfs/CaseInsensitiveFS.java index 78ce7b2..46b18ea 100644 --- a/sched/src/com/android/sched/vfs/CaseInsensitiveFS.java +++ b/sched/src/com/android/sched/vfs/CaseInsensitiveFS.java @@ -478,6 +478,11 @@ public class CaseInsensitiveFS extends BaseVFS<CaseInsensitiveVDir, CaseInsensit return list(dir).isEmpty(); } + @Override + public long getLastModified(@Nonnull CaseInsensitiveVFile file) { + return vfs.getLastModified(file.getEncodedFile()); + } + // // Location // diff --git a/sched/src/com/android/sched/vfs/DeflateFS.java b/sched/src/com/android/sched/vfs/DeflateFS.java index f805c2e..70fc31d 100644 --- a/sched/src/com/android/sched/vfs/DeflateFS.java +++ b/sched/src/com/android/sched/vfs/DeflateFS.java @@ -119,6 +119,11 @@ public class DeflateFS extends BaseVFS<BaseVDir, BaseVFile> implements VFS{ } @Override + long getLastModified(@Nonnull BaseVFile file) { + return vfs.getLastModified(file); + } + + @Override @Nonnull BaseVFile createVFile(@Nonnull BaseVDir parent, @Nonnull String name) throws CannotCreateFileException { diff --git a/sched/src/com/android/sched/vfs/DirectFS.java b/sched/src/com/android/sched/vfs/DirectFS.java index 4495439..1464cb3 100644 --- a/sched/src/com/android/sched/vfs/DirectFS.java +++ b/sched/src/com/android/sched/vfs/DirectFS.java @@ -255,6 +255,11 @@ public class DirectFS extends BaseVFS<ParentVDir, ParentVFile> implements VFS { } @Override + public long getLastModified(@Nonnull ParentVFile file) { + return getNativeFile(file.getPath()).lastModified(); + } + + @Override @Nonnull FileLocation getVFileLocation(@Nonnull ParentVFile file) { return new FileLocation(getNativeFile(file.getPath())); diff --git a/sched/src/com/android/sched/vfs/GenericInputOutputVFile.java b/sched/src/com/android/sched/vfs/GenericInputOutputVFile.java index b17adbc..d5fab6f 100644 --- a/sched/src/com/android/sched/vfs/GenericInputOutputVFile.java +++ b/sched/src/com/android/sched/vfs/GenericInputOutputVFile.java @@ -88,4 +88,9 @@ public class GenericInputOutputVFile implements InputOutputVFile { public VPath getPathFromRoot() { return file.getPathFromRoot(); } + + @Override + public long getLastModified() { + return file.getLastModified(); + } }
\ No newline at end of file diff --git a/sched/src/com/android/sched/vfs/GenericInputVFile.java b/sched/src/com/android/sched/vfs/GenericInputVFile.java index 74ea3aa..1406996 100644 --- a/sched/src/com/android/sched/vfs/GenericInputVFile.java +++ b/sched/src/com/android/sched/vfs/GenericInputVFile.java @@ -79,4 +79,9 @@ public class GenericInputVFile implements InputVFile { VFile getVFile() { return file; } + + @Override + public long getLastModified() { + return file.getLastModified(); + } }
\ No newline at end of file diff --git a/sched/src/com/android/sched/vfs/InputVFile.java b/sched/src/com/android/sched/vfs/InputVFile.java index cc494ed..7f61ea3 100644 --- a/sched/src/com/android/sched/vfs/InputVFile.java +++ b/sched/src/com/android/sched/vfs/InputVFile.java @@ -26,6 +26,9 @@ import javax.annotation.Nonnull; public interface InputVFile extends InputVElement, InputStreamProvider { void delete() throws CannotDeleteFileException; + @Nonnull VPath getPathFromRoot(); + + long getLastModified(); } diff --git a/sched/src/com/android/sched/vfs/MessageDigestFS.java b/sched/src/com/android/sched/vfs/MessageDigestFS.java index 25f1b84..7a181a1 100644 --- a/sched/src/com/android/sched/vfs/MessageDigestFS.java +++ b/sched/src/com/android/sched/vfs/MessageDigestFS.java @@ -291,6 +291,11 @@ public class MessageDigestFS extends BaseVFS<MessageDigestVDir, MessageDigestVFi } @Override + long getLastModified(@Nonnull MessageDigestVFile file) { + return vfs.getLastModified(file.getWrappedFile()); + } + + @Override public synchronized void close() throws CannotCreateFileException, WrongPermissionException, IOException { if (!closed) { diff --git a/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java b/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java index bc06970..adea71f 100644 --- a/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java +++ b/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java @@ -97,6 +97,12 @@ public class MessageDigestInputVFS extends MessageDigestVFS implements InputVFS } @Override + public long getLastModified() { + // This implementation is obsolete anyway + throw new UnsupportedOperationException(); + } + + @Override public void delete() { // This implementation is obsolete anyway throw new UnsupportedOperationException(); diff --git a/sched/src/com/android/sched/vfs/PrefixedFS.java b/sched/src/com/android/sched/vfs/PrefixedFS.java index cc63ea4..7b8bc3f 100644 --- a/sched/src/com/android/sched/vfs/PrefixedFS.java +++ b/sched/src/com/android/sched/vfs/PrefixedFS.java @@ -158,6 +158,11 @@ public class PrefixedFS extends BaseVFS<BaseVDir, BaseVFile> implements VFS { } @Override + long getLastModified(@Nonnull BaseVFile file) { + return vfs.getLastModified(file); + } + + @Override @Nonnull Location getVFileLocation(@Nonnull BaseVFile file) { return vfs.getVFileLocation(file); diff --git a/sched/src/com/android/sched/vfs/ReadWriteZipFS.java b/sched/src/com/android/sched/vfs/ReadWriteZipFS.java index 0ada64d..2ee080b 100644 --- a/sched/src/com/android/sched/vfs/ReadWriteZipFS.java +++ b/sched/src/com/android/sched/vfs/ReadWriteZipFS.java @@ -168,6 +168,11 @@ public class ReadWriteZipFS extends BaseVFS<BaseVDir, BaseVFile> implements VFS } @Override + long getLastModified(@Nonnull BaseVFile file) { + throw new UnsupportedOperationException(); + } + + @Override @Nonnull Location getVFileLocation(@Nonnull BaseVFile file) { return vfs.getVFileLocation(file); diff --git a/sched/src/com/android/sched/vfs/ReadZipFS.java b/sched/src/com/android/sched/vfs/ReadZipFS.java index 60badad..eeb3a6e 100644 --- a/sched/src/com/android/sched/vfs/ReadZipFS.java +++ b/sched/src/com/android/sched/vfs/ReadZipFS.java @@ -293,6 +293,11 @@ public class ReadZipFS extends BaseVFS<ZipVDir, ZipVFile> implements VFS { return list(dir).isEmpty(); } + @Override + long getLastModified(@Nonnull ZipVFile file) { + return inputZipFile.getLastModified(); + } + // // Location // diff --git a/sched/src/com/android/sched/vfs/VFSToVFSWrapper.java b/sched/src/com/android/sched/vfs/VFSToVFSWrapper.java index 0a79757..df733f4 100644 --- a/sched/src/com/android/sched/vfs/VFSToVFSWrapper.java +++ b/sched/src/com/android/sched/vfs/VFSToVFSWrapper.java @@ -219,6 +219,11 @@ public class VFSToVFSWrapper extends BaseVFS<BaseVDir, BaseVFile> implements VFS } @Override + long getLastModified(@Nonnull BaseVFile file) { + throw new UnsupportedOperationException(); + } + + @Override @Nonnull Location getVFileLocation(@Nonnull BaseVFile file) { return workVFS.getVFileLocation(file); diff --git a/sched/src/com/android/sched/vfs/VFile.java b/sched/src/com/android/sched/vfs/VFile.java index 75553e5..5e172d3 100644 --- a/sched/src/com/android/sched/vfs/VFile.java +++ b/sched/src/com/android/sched/vfs/VFile.java @@ -31,6 +31,8 @@ public interface VFile extends VElement, InputStreamProvider, OutputStreamProvid @CheckForNull String getDigest(); + long getLastModified(); + void delete() throws CannotDeleteFileException; @Nonnull VPath getPathFromRoot(); diff --git a/sched/src/com/android/sched/vfs/WriteZipFS.java b/sched/src/com/android/sched/vfs/WriteZipFS.java index 8135220..2370117 100644 --- a/sched/src/com/android/sched/vfs/WriteZipFS.java +++ b/sched/src/com/android/sched/vfs/WriteZipFS.java @@ -220,6 +220,11 @@ public class WriteZipFS extends BaseVFS<ZipVDir, ZipVFile> implements VFS { throw new UnsupportedOperationException(); } + @Override + long getLastModified(@Nonnull ZipVFile file) { + throw new UnsupportedOperationException(); + } + // // Location // |