summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jack/src/com/android/jack/frontend/java/JackBatchCompiler.java4
-rw-r--r--jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java7
-rw-r--r--jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java11
-rw-r--r--jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java7
-rw-r--r--sched/src/com/android/sched/util/config/cli/TokenIterator.java5
-rw-r--r--sched/src/com/android/sched/util/file/AbstractStreamFile.java6
-rw-r--r--sched/src/com/android/sched/util/file/Directory.java6
-rw-r--r--sched/src/com/android/sched/util/file/InputFile.java2
-rw-r--r--sched/src/com/android/sched/util/file/InputOutputFile.java2
-rw-r--r--sched/src/com/android/sched/util/file/InputStreamFile.java2
-rw-r--r--sched/src/com/android/sched/util/file/InputZipFile.java2
-rw-r--r--sched/src/com/android/sched/util/file/NotDirectoryException.java38
-rw-r--r--sched/src/com/android/sched/util/file/NotFileException.java38
-rw-r--r--sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java2
-rw-r--r--sched/src/com/android/sched/util/file/OutputFile.java2
-rw-r--r--sched/src/com/android/sched/util/file/OutputStreamFile.java4
-rw-r--r--sched/src/com/android/sched/util/file/OutputZipFile.java2
-rw-r--r--sched/src/com/android/sched/util/file/StreamFile.java2
-rw-r--r--sched/src/com/android/sched/vfs/DirectDir.java21
-rw-r--r--sched/src/com/android/sched/vfs/DirectFile.java6
-rw-r--r--sched/src/com/android/sched/vfs/DirectVFS.java4
-rw-r--r--sched/src/com/android/sched/vfs/InputOutputVDir.java6
-rw-r--r--sched/src/com/android/sched/vfs/InputOutputZipVDir.java13
-rw-r--r--sched/src/com/android/sched/vfs/InputVDir.java7
-rw-r--r--sched/src/com/android/sched/vfs/InputZipVDir.java11
-rw-r--r--sched/src/com/android/sched/vfs/MessageDigestInputVFS.java9
-rw-r--r--sched/src/com/android/sched/vfs/PrefixedInputVFS.java4
-rw-r--r--sched/src/com/android/sched/vfs/PrefixedOutputVFS.java4
28 files changed, 156 insertions, 71 deletions
diff --git a/jack/src/com/android/jack/frontend/java/JackBatchCompiler.java b/jack/src/com/android/jack/frontend/java/JackBatchCompiler.java
index 3423aaed..0106851c 100644
--- a/jack/src/com/android/jack/frontend/java/JackBatchCompiler.java
+++ b/jack/src/com/android/jack/frontend/java/JackBatchCompiler.java
@@ -22,7 +22,7 @@ import com.android.jack.ir.ast.JSession;
import com.android.jack.reporting.Reporter;
import com.android.sched.util.file.InputStreamFile;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotFileException;
import com.android.sched.util.file.WrongPermissionException;
import com.android.sched.util.log.LoggerFactory;
@@ -261,7 +261,7 @@ public class JackBatchCompiler extends Main {
throw new JackUserException(e);
} catch (NoSuchFileException e) {
throw new JackUserException(e);
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotFileException e) {
throw new JackUserException(e);
}
}
diff --git a/jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java b/jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java
index 4db3adc1..7295d3e3 100644
--- a/jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java
+++ b/jack/src/com/android/jack/library/v0000/InputJackLibraryImpl.java
@@ -28,7 +28,8 @@ import com.android.jack.library.LibraryIOException;
import com.android.jack.library.LibraryVersionException;
import com.android.sched.util.file.CannotDeleteFileException;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
+import com.android.sched.util.file.NotFileException;
import com.android.sched.util.log.LoggerFactory;
import com.android.sched.vfs.InputVDir;
import com.android.sched.vfs.InputVFS;
@@ -126,7 +127,7 @@ public class InputJackLibraryImpl extends InputJackLibrary {
VPath clonedPath = typePath.clone();
clonedPath.addSuffix(fileType.getFileExtension());
return vfs.getRootInputVDir().getInputVFile(clonedPath);
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotFileException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
} catch (NoSuchFileException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
@@ -139,7 +140,7 @@ public class InputJackLibraryImpl extends InputJackLibrary {
throws FileTypeDoesNotExistException {
try {
return vfs.getRootInputVDir().getInputVDir(typePath);
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
} catch (NoSuchFileException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
diff --git a/jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java b/jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java
index ccdf9671..cb87a2d4 100644
--- a/jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java
+++ b/jack/src/com/android/jack/library/v0001/InputJackLibraryImpl.java
@@ -28,6 +28,7 @@ import com.android.jack.library.LibraryIOException;
import com.android.jack.library.LibraryVersionException;
import com.android.sched.util.file.CannotDeleteFileException;
import com.android.sched.util.file.NoSuchFileException;
+import com.android.sched.util.file.NotDirectoryException;
import com.android.sched.util.file.NotFileOrDirectoryException;
import com.android.sched.util.log.LoggerFactory;
import com.android.sched.vfs.InputVDir;
@@ -139,7 +140,7 @@ public class InputJackLibraryImpl extends InputJackLibrary {
try {
InputVFS currentSectionVFS = getSectionVFS(fileType);
return currentSectionVFS.getRootInputVDir().getInputVDir(typePath);
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
} catch (NoSuchFileException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
@@ -157,7 +158,7 @@ public class InputJackLibraryImpl extends InputJackLibrary {
try {
InputVFS currentSectionVFS = getSectionVFS(fileType);
fillFiles(currentSectionVFS.getRootInputVDir(), fileType, inputVFiles);
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
throw new AssertionError(
getLocation().getDescription() + " is an invalid library: " + e.getMessage());
} catch (NoSuchFileException e) {
@@ -169,7 +170,7 @@ public class InputJackLibraryImpl extends InputJackLibrary {
@Nonnull
private synchronized InputVFS getSectionVFS(@Nonnull FileType fileType)
- throws NotFileOrDirectoryException, NoSuchFileException {
+ throws NotDirectoryException, NoSuchFileException {
InputVFS currentSectionVFS;
if (sectionVFS.containsKey(fileType)) {
currentSectionVFS = sectionVFS.get(fileType);
@@ -229,7 +230,7 @@ public class InputJackLibraryImpl extends InputJackLibrary {
try {
InputVFS currentSectionVFS = getSectionVFS(fileType);
currentSectionVFS.getRootInputVDir().delete(buildFileVPath(fileType, typePath));
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
} catch (NoSuchFileException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
@@ -257,7 +258,7 @@ public class InputJackLibraryImpl extends InputJackLibrary {
} else {
try {
return ((MessageDigestInputVFS) getSectionVFS(FileType.DEX)).getDigest();
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
// we already checked that the library contained dex files
throw new AssertionError(e);
} catch (NoSuchFileException e) {
diff --git a/jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java b/jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java
index 5d9415ef..c4658064 100644
--- a/jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java
+++ b/jack/src/com/android/jack/library/v0001/OutputJackLibraryImpl.java
@@ -29,6 +29,7 @@ import com.android.sched.util.config.ThreadConfig;
import com.android.sched.util.file.CannotCreateFileException;
import com.android.sched.util.file.CannotDeleteFileException;
import com.android.sched.util.file.NoSuchFileException;
+import com.android.sched.util.file.NotDirectoryException;
import com.android.sched.util.file.NotFileOrDirectoryException;
import com.android.sched.vfs.InputOutputVFS;
import com.android.sched.vfs.InputVFS;
@@ -131,7 +132,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary {
@SuppressWarnings("resource")
@Nonnull
private synchronized VFSPair getSectionVFS(@Nonnull FileType fileType)
- throws NotFileOrDirectoryException, CannotCreateFileException {
+ throws NotDirectoryException, CannotCreateFileException {
VFSPair currentSectionVFS;
if (sectionVFS.containsKey(fileType)) {
currentSectionVFS = sectionVFS.get(fileType);
@@ -212,7 +213,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary {
try {
VFSPair currentSectionVFS = getSectionVFS(fileType);
fillFiles(currentSectionVFS.getInputVFS().getRootInputVDir(), fileType, inputVFiles);
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
// we already checked that the library contained the file type
throw new AssertionError(e);
} catch (CannotCreateFileException e) {
@@ -247,7 +248,7 @@ public class OutputJackLibraryImpl extends OutputJackLibrary {
try {
VFSPair currentSectionVFS = getSectionVFS(fileType);
currentSectionVFS.getInputVFS().getRootInputVDir().delete(buildFileVPath(fileType, typePath));
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
} catch (CannotCreateFileException e) {
throw new FileTypeDoesNotExistException(getLocation(), typePath, fileType);
diff --git a/sched/src/com/android/sched/util/config/cli/TokenIterator.java b/sched/src/com/android/sched/util/config/cli/TokenIterator.java
index 1ab3a0c8..348f661a 100644
--- a/sched/src/com/android/sched/util/config/cli/TokenIterator.java
+++ b/sched/src/com/android/sched/util/config/cli/TokenIterator.java
@@ -19,6 +19,7 @@ package com.android.sched.util.config.cli;
import com.android.sched.util.file.CannotReadException;
import com.android.sched.util.file.InputStreamFile;
import com.android.sched.util.file.NoSuchFileException;
+import com.android.sched.util.file.NotFileException;
import com.android.sched.util.file.NotFileOrDirectoryException;
import com.android.sched.util.file.WrongPermissionException;
import com.android.sched.util.location.FileLocation;
@@ -190,7 +191,7 @@ public class TokenIterator {
throws NoSuchElementException,
WrongPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException,
+ NotFileException,
CannotReadException {
while (true) {
@@ -245,7 +246,7 @@ public class TokenIterator {
}
private void pushFileTokenizer(@Nonnull String fileName) throws WrongPermissionException,
- NoSuchFileException, NotFileOrDirectoryException {
+ NoSuchFileException, NotFileException {
InputStreamFile file = new InputStreamFile(fileName);
tokenizers.push(getTokenizer(file));
diff --git a/sched/src/com/android/sched/util/file/AbstractStreamFile.java b/sched/src/com/android/sched/util/file/AbstractStreamFile.java
index 14fa8bfe..54497aa2 100644
--- a/sched/src/com/android/sched/util/file/AbstractStreamFile.java
+++ b/sched/src/com/android/sched/util/file/AbstractStreamFile.java
@@ -65,7 +65,7 @@ public abstract class AbstractStreamFile extends FileOrDirectory {
protected void performChecks(@Nonnull Existence existence, int permissions,
@Nonnull ChangePermission change)
throws NoSuchFileException,
- NotFileOrDirectoryException,
+ NotFileException,
WrongPermissionException,
FileAlreadyExistsException,
CannotCreateFileException,
@@ -130,7 +130,7 @@ public abstract class AbstractStreamFile extends FileOrDirectory {
}
private void processExisting(int permissions)
- throws NoSuchFileException, NotFileOrDirectoryException, WrongPermissionException {
+ throws NoSuchFileException, NotFileException, WrongPermissionException {
assert file != null;
// Check existing
@@ -140,7 +140,7 @@ public abstract class AbstractStreamFile extends FileOrDirectory {
// Check it is a file
if (!file.isFile()) {
- throw new NotFileOrDirectoryException((FileOrDirLocation) location);
+ throw new NotFileException((FileLocation) location);
}
checkPermissions(file, permissions);
diff --git a/sched/src/com/android/sched/util/file/Directory.java b/sched/src/com/android/sched/util/file/Directory.java
index 3949daa0..2e099862 100644
--- a/sched/src/com/android/sched/util/file/Directory.java
+++ b/sched/src/com/android/sched/util/file/Directory.java
@@ -42,7 +42,7 @@ public class Directory extends FileOrDirectory {
throws WrongPermissionException,
CannotSetPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException,
+ NotDirectoryException,
FileAlreadyExistsException,
CannotCreateFileException {
super(hooks);
@@ -84,7 +84,7 @@ public class Directory extends FileOrDirectory {
}
private void processExisting(int permissions)
- throws WrongPermissionException, NoSuchFileException, NotFileOrDirectoryException {
+ throws WrongPermissionException, NoSuchFileException, NotDirectoryException {
assert file != null;
// Check existing
@@ -94,7 +94,7 @@ public class Directory extends FileOrDirectory {
// Check directory
if (!file.isDirectory()) {
- throw new NotFileOrDirectoryException((FileOrDirLocation) location);
+ throw new NotDirectoryException((DirectoryLocation) location);
}
checkPermissions(file, permissions);
diff --git a/sched/src/com/android/sched/util/file/InputFile.java b/sched/src/com/android/sched/util/file/InputFile.java
index 783f791f..aae29550 100644
--- a/sched/src/com/android/sched/util/file/InputFile.java
+++ b/sched/src/com/android/sched/util/file/InputFile.java
@@ -29,7 +29,7 @@ public class InputFile extends InputOutputFile {
CannotSetPermissionException,
WrongPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException {
+ NotFileException {
super(name, /* hooks */ null, Existence.MUST_EXIST, Permission.READ, change);
}
}
diff --git a/sched/src/com/android/sched/util/file/InputOutputFile.java b/sched/src/com/android/sched/util/file/InputOutputFile.java
index 6a7acd5b..aaa892ee 100644
--- a/sched/src/com/android/sched/util/file/InputOutputFile.java
+++ b/sched/src/com/android/sched/util/file/InputOutputFile.java
@@ -37,7 +37,7 @@ public class InputOutputFile extends StreamFile {
CannotSetPermissionException,
WrongPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException {
+ NotFileException {
super(name, hooks, existence, permissions, change);
}
diff --git a/sched/src/com/android/sched/util/file/InputStreamFile.java b/sched/src/com/android/sched/util/file/InputStreamFile.java
index d66865cb..9f5a6d65 100644
--- a/sched/src/com/android/sched/util/file/InputStreamFile.java
+++ b/sched/src/com/android/sched/util/file/InputStreamFile.java
@@ -30,7 +30,7 @@ import javax.annotation.Nonnull;
*/
public class InputStreamFile extends AbstractStreamFile {
public InputStreamFile(@Nonnull String name)
- throws WrongPermissionException, NotFileOrDirectoryException, NoSuchFileException {
+ throws WrongPermissionException, NotFileException, NoSuchFileException {
super(name, null /* hooks */);
try {
diff --git a/sched/src/com/android/sched/util/file/InputZipFile.java b/sched/src/com/android/sched/util/file/InputZipFile.java
index aa4e86b3..7dccb58e 100644
--- a/sched/src/com/android/sched/util/file/InputZipFile.java
+++ b/sched/src/com/android/sched/util/file/InputZipFile.java
@@ -42,7 +42,7 @@ public class InputZipFile extends StreamFile {
CannotSetPermissionException,
WrongPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException,
+ NotFileException,
ZipException {
super(name, hooks, existence, Permission.READ, change);
zipFile = processZip(file);
diff --git a/sched/src/com/android/sched/util/file/NotDirectoryException.java b/sched/src/com/android/sched/util/file/NotDirectoryException.java
new file mode 100644
index 00000000..6becd823
--- /dev/null
+++ b/sched/src/com/android/sched/util/file/NotDirectoryException.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.sched.util.file;
+
+import com.android.sched.util.location.DirectoryLocation;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+/**
+ * Exception when a path is a file when it is expected to be a directory.
+ */
+public class NotDirectoryException extends NotFileOrDirectoryException {
+ private static final long serialVersionUID = 1L;
+
+ public NotDirectoryException(@Nonnull DirectoryLocation location) {
+ super(location);
+ }
+
+ public NotDirectoryException(@Nonnull DirectoryLocation location,
+ @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+}
diff --git a/sched/src/com/android/sched/util/file/NotFileException.java b/sched/src/com/android/sched/util/file/NotFileException.java
new file mode 100644
index 00000000..f5e6532b
--- /dev/null
+++ b/sched/src/com/android/sched/util/file/NotFileException.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.sched.util.file;
+
+import com.android.sched.util.location.FileLocation;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+/**
+ * Exception when a path is a directory when it is expected to be a file.
+ */
+public class NotFileException extends NotFileOrDirectoryException {
+ private static final long serialVersionUID = 1L;
+
+ public NotFileException(@Nonnull FileLocation location) {
+ super(location);
+ }
+
+ public NotFileException(@Nonnull FileLocation location,
+ @CheckForNull Throwable cause) {
+ super(location, cause);
+ }
+}
diff --git a/sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java b/sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java
index fe08ebed..a7792899 100644
--- a/sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java
+++ b/sched/src/com/android/sched/util/file/NotFileOrDirectoryException.java
@@ -27,7 +27,7 @@ import javax.annotation.Nonnull;
/**
* Exception when a path is not from the expected file or directory kind.
*/
-public class NotFileOrDirectoryException extends IOException {
+public abstract class NotFileOrDirectoryException extends IOException {
private static final long serialVersionUID = 1L;
public NotFileOrDirectoryException(@Nonnull FileOrDirLocation location) {
diff --git a/sched/src/com/android/sched/util/file/OutputFile.java b/sched/src/com/android/sched/util/file/OutputFile.java
index 311c3512..007babd7 100644
--- a/sched/src/com/android/sched/util/file/OutputFile.java
+++ b/sched/src/com/android/sched/util/file/OutputFile.java
@@ -35,7 +35,7 @@ public class OutputFile extends InputOutputFile {
CannotSetPermissionException,
WrongPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException {
+ NotFileException {
super(name, hooks, existence, permissions, change);
}
}
diff --git a/sched/src/com/android/sched/util/file/OutputStreamFile.java b/sched/src/com/android/sched/util/file/OutputStreamFile.java
index 17874392..59fa2474 100644
--- a/sched/src/com/android/sched/util/file/OutputStreamFile.java
+++ b/sched/src/com/android/sched/util/file/OutputStreamFile.java
@@ -45,7 +45,7 @@ public class OutputStreamFile extends AbstractStreamFile {
CannotSetPermissionException,
WrongPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException {
+ NotFileException {
super(name, hooks);
performChecks(existence, Permission.WRITE, change);
@@ -61,7 +61,7 @@ public class OutputStreamFile extends AbstractStreamFile {
@CheckForNull RunnableHooks hooks)
throws CannotCreateFileException,
WrongPermissionException,
- NotFileOrDirectoryException {
+ NotFileException {
super(name, hooks);
try {
diff --git a/sched/src/com/android/sched/util/file/OutputZipFile.java b/sched/src/com/android/sched/util/file/OutputZipFile.java
index ad15ef3b..3237ae13 100644
--- a/sched/src/com/android/sched/util/file/OutputZipFile.java
+++ b/sched/src/com/android/sched/util/file/OutputZipFile.java
@@ -45,7 +45,7 @@ public class OutputZipFile extends OutputStreamFile {
CannotSetPermissionException,
WrongPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException {
+ NotFileException {
super(name, hooks, existence, change, false);
}
diff --git a/sched/src/com/android/sched/util/file/StreamFile.java b/sched/src/com/android/sched/util/file/StreamFile.java
index 9e1086fd..863b7ca4 100644
--- a/sched/src/com/android/sched/util/file/StreamFile.java
+++ b/sched/src/com/android/sched/util/file/StreamFile.java
@@ -37,7 +37,7 @@ public class StreamFile extends AbstractStreamFile {
CannotSetPermissionException,
WrongPermissionException,
NoSuchFileException,
- NotFileOrDirectoryException {
+ NotFileException {
super(name, hooks);
performChecks(existence, permissions, change);
diff --git a/sched/src/com/android/sched/vfs/DirectDir.java b/sched/src/com/android/sched/vfs/DirectDir.java
index eb234bdd..058918cc 100644
--- a/sched/src/com/android/sched/vfs/DirectDir.java
+++ b/sched/src/com/android/sched/vfs/DirectDir.java
@@ -20,7 +20,8 @@ import com.android.sched.util.ConcurrentIOException;
import com.android.sched.util.file.CannotCreateFileException;
import com.android.sched.util.file.CannotDeleteFileException;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
+import com.android.sched.util.file.NotFileException;
import com.android.sched.util.location.DirectoryLocation;
import com.android.sched.util.location.FileLocation;
import com.android.sched.util.location.Location;
@@ -42,9 +43,9 @@ public class DirectDir extends AbstractVElement implements InputOutputVDir {
private final InputOutputVFS vfs;
DirectDir(@Nonnull File dir, @Nonnull InputOutputVFS vfs)
- throws NotFileOrDirectoryException {
+ throws NotDirectoryException {
if (!dir.isDirectory()) {
- throw new NotFileOrDirectoryException(new DirectoryLocation(dir));
+ throw new NotDirectoryException(new DirectoryLocation(dir));
}
this.dir = dir;
this.vfs = vfs;
@@ -75,7 +76,7 @@ public class DirectDir extends AbstractVElement implements InputOutputVDir {
} else {
items.add(new DirectDir(sub, vfs));
}
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
throw new ConcurrentIOException(e);
}
}
@@ -91,28 +92,28 @@ public class DirectDir extends AbstractVElement implements InputOutputVDir {
@Override
@Nonnull
- public InputVFile getInputVFile(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ public InputVFile getInputVFile(@Nonnull VPath path) throws NotFileException,
NoSuchFileException {
File file = new File(dir, path.getPathAsString(File.separatorChar));
if (!file.exists()) {
throw new NoSuchFileException(new FileLocation(file));
}
if (!file.isFile()) {
- throw new NotFileOrDirectoryException(new FileLocation(file));
+ throw new NotFileException(new FileLocation(file));
}
return new DirectFile(file, vfs);
}
@Override
@Nonnull
- public InputOutputVDir getInputVDir(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ public InputOutputVDir getInputVDir(@Nonnull VPath path) throws NotDirectoryException,
NoSuchFileException {
File file = new File(dir, path.getPathAsString(File.separatorChar));
if (!file.exists()) {
- throw new NoSuchFileException(new FileLocation(file));
+ throw new NoSuchFileException(new DirectoryLocation(file));
}
if (file.isFile()) {
- throw new NotFileOrDirectoryException(new FileLocation(file));
+ throw new NotDirectoryException(new DirectoryLocation(file));
}
return new DirectDir(file, vfs);
}
@@ -130,7 +131,7 @@ public class DirectDir extends AbstractVElement implements InputOutputVDir {
@Override
@Nonnull
public OutputVDir createOutputVDir(@Nonnull VPath path) throws CannotCreateFileException,
- NotFileOrDirectoryException {
+ NotDirectoryException {
File file = new File(dir, path.getPathAsString(File.separatorChar));
if (!file.getParentFile().mkdirs() && !file.getParentFile().isDirectory()) {
throw new CannotCreateFileException(new DirectoryLocation(file.getParentFile()));
diff --git a/sched/src/com/android/sched/vfs/DirectFile.java b/sched/src/com/android/sched/vfs/DirectFile.java
index 202fbbbb..21767239 100644
--- a/sched/src/com/android/sched/vfs/DirectFile.java
+++ b/sched/src/com/android/sched/vfs/DirectFile.java
@@ -20,7 +20,7 @@ import com.android.sched.util.ConcurrentIOException;
import com.android.sched.util.file.CannotCreateFileException;
import com.android.sched.util.file.InputStreamFile;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotFileException;
import com.android.sched.util.file.OutputStreamFile;
import com.android.sched.util.file.WrongPermissionException;
import com.android.sched.util.location.FileLocation;
@@ -57,7 +57,7 @@ public class DirectFile extends AbstractVElement implements InputOutputVFile {
} catch (NoSuchFileException e) {
// we have already checked that the file exists when creating the VFile in the VDir
throw new ConcurrentIOException(e);
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotFileException e) {
// we have already checked that this is not a directory when creating the VFile in the VDir
throw new ConcurrentIOException(e);
}
@@ -66,7 +66,7 @@ public class DirectFile extends AbstractVElement implements InputOutputVFile {
@Nonnull
@Override
public OutputStream openWrite() throws CannotCreateFileException, WrongPermissionException,
- NotFileOrDirectoryException {
+ NotFileException {
if (vfs instanceof SequentialOutputVFS) {
if (((SequentialOutputVFS) vfs).notifyVFileOpenAndReturnPreviousState()) {
throw new AssertionError(getLocation().getDescription()
diff --git a/sched/src/com/android/sched/vfs/DirectVFS.java b/sched/src/com/android/sched/vfs/DirectVFS.java
index e0fa7657..b1ca1fbc 100644
--- a/sched/src/com/android/sched/vfs/DirectVFS.java
+++ b/sched/src/com/android/sched/vfs/DirectVFS.java
@@ -18,7 +18,7 @@ package com.android.sched.vfs;
import com.android.sched.util.ConcurrentIOException;
import com.android.sched.util.file.Directory;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
import com.android.sched.util.location.Location;
import javax.annotation.Nonnull;
@@ -35,7 +35,7 @@ public class DirectVFS extends AbstractInputOutputVFS implements ParallelOutputV
try {
setRootDir(new DirectDir(dir.getFile(), this));
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotDirectoryException e) {
throw new ConcurrentIOException(e);
}
}
diff --git a/sched/src/com/android/sched/vfs/InputOutputVDir.java b/sched/src/com/android/sched/vfs/InputOutputVDir.java
index 0a325277..43c6e94c 100644
--- a/sched/src/com/android/sched/vfs/InputOutputVDir.java
+++ b/sched/src/com/android/sched/vfs/InputOutputVDir.java
@@ -18,7 +18,7 @@ package com.android.sched.vfs;
import com.android.sched.util.file.CannotCreateFileException;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
import javax.annotation.Nonnull;
@@ -29,10 +29,10 @@ public interface InputOutputVDir extends InputVDir, OutputVDir {
@Override
@Nonnull
- public InputOutputVDir getInputVDir(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ public InputOutputVDir getInputVDir(@Nonnull VPath path) throws NotDirectoryException,
NoSuchFileException;
@Nonnull
public OutputVDir createOutputVDir(@Nonnull VPath path) throws CannotCreateFileException,
- NotFileOrDirectoryException;
+ NotDirectoryException;
}
diff --git a/sched/src/com/android/sched/vfs/InputOutputZipVDir.java b/sched/src/com/android/sched/vfs/InputOutputZipVDir.java
index 80f51b21..5511638b 100644
--- a/sched/src/com/android/sched/vfs/InputOutputZipVDir.java
+++ b/sched/src/com/android/sched/vfs/InputOutputZipVDir.java
@@ -20,7 +20,8 @@ import com.android.sched.util.ConcurrentIOException;
import com.android.sched.util.file.CannotCreateFileException;
import com.android.sched.util.file.CannotDeleteFileException;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
+import com.android.sched.util.file.NotFileException;
import com.android.sched.util.location.DirectoryLocation;
import com.android.sched.util.location.FileLocation;
import com.android.sched.util.location.Location;
@@ -137,14 +138,14 @@ class InputOutputZipVDir extends AbstractVElement implements InputOutputVDir {
@Override
@Nonnull
- public InputOutputVDir getInputVDir(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ public InputOutputVDir getInputVDir(@Nonnull VPath path) throws NotDirectoryException,
NoSuchFileException {
File file = new File(dir, path.getPathAsString(File.separatorChar));
if (!file.exists()) {
- throw new NoSuchFileException(new FileLocation(file));
+ throw new NoSuchFileException(new DirectoryLocation(file));
}
if (file.isFile()) {
- throw new NotFileOrDirectoryException(new FileLocation(file));
+ throw new NotDirectoryException(new DirectoryLocation(file));
}
return new InputOutputZipVDir(vfs, file,
new ZipEntry(path.getPathAsString(ZipUtils.ZIP_SEPARATOR) + ZipUtils.ZIP_SEPARATOR));
@@ -152,14 +153,14 @@ class InputOutputZipVDir extends AbstractVElement implements InputOutputVDir {
@Override
@Nonnull
- public InputVFile getInputVFile(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ public InputVFile getInputVFile(@Nonnull VPath path) throws NotFileException,
NoSuchFileException {
File file = new File(dir, path.getPathAsString(File.separatorChar));
if (!file.exists()) {
throw new NoSuchFileException(new FileLocation(file));
}
if (!file.isFile()) {
- throw new NotFileOrDirectoryException(new FileLocation(file));
+ throw new NotFileException(new FileLocation(file));
}
return new InputOutputZipVFile(vfs, file,
new ZipEntry(path.getPathAsString(ZipUtils.ZIP_SEPARATOR)));
diff --git a/sched/src/com/android/sched/vfs/InputVDir.java b/sched/src/com/android/sched/vfs/InputVDir.java
index a4dd7b34..5129e3d8 100644
--- a/sched/src/com/android/sched/vfs/InputVDir.java
+++ b/sched/src/com/android/sched/vfs/InputVDir.java
@@ -18,7 +18,8 @@ package com.android.sched.vfs;
import com.android.sched.util.file.CannotDeleteFileException;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
+import com.android.sched.util.file.NotFileException;
import java.util.Collection;
@@ -33,11 +34,11 @@ public interface InputVDir extends InputVElement {
Collection<? extends InputVElement> list();
@Nonnull
- InputVDir getInputVDir(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ InputVDir getInputVDir(@Nonnull VPath path) throws NotDirectoryException,
NoSuchFileException;
@Nonnull
- InputVFile getInputVFile(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ InputVFile getInputVFile(@Nonnull VPath path) throws NotFileException,
NoSuchFileException;
@Nonnull
diff --git a/sched/src/com/android/sched/vfs/InputZipVDir.java b/sched/src/com/android/sched/vfs/InputZipVDir.java
index 30b781b5..eed0a3ad 100644
--- a/sched/src/com/android/sched/vfs/InputZipVDir.java
+++ b/sched/src/com/android/sched/vfs/InputZipVDir.java
@@ -17,7 +17,8 @@
package com.android.sched.vfs;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
+import com.android.sched.util.file.NotFileException;
import com.android.sched.util.location.DirectoryLocation;
import com.android.sched.util.location.FileLocation;
import com.android.sched.util.location.Location;
@@ -69,7 +70,7 @@ class InputZipVDir extends AbstractVElement implements InputVDir {
@Override
@Nonnull
- public InputVFile getInputVFile(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ public InputVFile getInputVFile(@Nonnull VPath path) throws NotFileException,
NoSuchFileException {
Iterator<String> iterator = path.split().iterator();
assert iterator.hasNext();
@@ -90,7 +91,7 @@ class InputZipVDir extends AbstractVElement implements InputVDir {
}
if (ive.isVDir()) {
- throw new NotFileOrDirectoryException(new DirectoryLocation(pathAsString));
+ throw new NotFileException(new FileLocation(pathAsString));
}
return (InputVFile) ive;
@@ -98,7 +99,7 @@ class InputZipVDir extends AbstractVElement implements InputVDir {
@Override
@Nonnull
- public InputVDir getInputVDir(@Nonnull VPath path) throws NotFileOrDirectoryException,
+ public InputVDir getInputVDir(@Nonnull VPath path) throws NotDirectoryException,
NoSuchFileException {
if (path.equals(VPath.ROOT)) {
return this;
@@ -123,7 +124,7 @@ class InputZipVDir extends AbstractVElement implements InputVDir {
}
if (!ive.isVDir()) {
- throw new NotFileOrDirectoryException(new DirectoryLocation(pathAsString));
+ throw new NotDirectoryException(new DirectoryLocation(pathAsString));
}
return (InputVDir) ive;
diff --git a/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java b/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java
index f0591bd3..10257ff7 100644
--- a/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java
+++ b/sched/src/com/android/sched/vfs/MessageDigestInputVFS.java
@@ -18,7 +18,8 @@ package com.android.sched.vfs;
import com.android.sched.util.file.CannotDeleteFileException;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
+import com.android.sched.util.file.NotFileException;
import com.android.sched.util.location.Location;
import com.android.sched.util.log.LoggerFactory;
@@ -136,7 +137,7 @@ public class MessageDigestInputVFS extends MessageDigestVFS implements InputVFS
@Override
@Nonnull
public MessageDigestInputVDir getInputVDir(@Nonnull VPath path)
- throws NotFileOrDirectoryException, NoSuchFileException {
+ throws NotDirectoryException, NoSuchFileException {
VPath newPathToRoot = pathToRoot.clone();
newPathToRoot.appendPath(path);
return new MessageDigestInputVDir(dir.getInputVDir(path), newPathToRoot);
@@ -145,7 +146,7 @@ public class MessageDigestInputVFS extends MessageDigestVFS implements InputVFS
@Override
@Nonnull
public MessageDigestInputVFile getInputVFile(@Nonnull VPath path)
- throws NotFileOrDirectoryException, NoSuchFileException {
+ throws NotFileException, NoSuchFileException {
VPath filePathToRoot = pathToRoot.clone();
filePathToRoot.appendPath(path);
return new MessageDigestInputVFile(dir.getInputVFile(path), digests.get(filePathToRoot));
@@ -169,7 +170,7 @@ public class MessageDigestInputVFS extends MessageDigestVFS implements InputVFS
try {
try {
file = root.getInputVFile(new VPath(DIGEST_DIRECTORY_NAME, '/'));
- } catch (NotFileOrDirectoryException e) {
+ } catch (NotFileException e) {
logger.log(Level.WARNING, "Cannot open '" + DIGEST_DIRECTORY_NAME + "' file in {0}", vfs
.getLocation().getDescription());
logger.log(Level.WARNING, "Stacktrace", e);
diff --git a/sched/src/com/android/sched/vfs/PrefixedInputVFS.java b/sched/src/com/android/sched/vfs/PrefixedInputVFS.java
index f1a5dc44..517f5ee2 100644
--- a/sched/src/com/android/sched/vfs/PrefixedInputVFS.java
+++ b/sched/src/com/android/sched/vfs/PrefixedInputVFS.java
@@ -17,7 +17,7 @@
package com.android.sched.vfs;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
import com.android.sched.util.location.Location;
import javax.annotation.Nonnull;
@@ -29,7 +29,7 @@ import javax.annotation.Nonnull;
public class PrefixedInputVFS extends AbstractInputVFS {
public PrefixedInputVFS(@Nonnull InputVFS inputVFS, @Nonnull VPath path)
- throws NotFileOrDirectoryException, NoSuchFileException {
+ throws NotDirectoryException, NoSuchFileException {
InputVDir previousRootDir = inputVFS.getRootInputVDir();
setRootDir(previousRootDir.getInputVDir(path));
}
diff --git a/sched/src/com/android/sched/vfs/PrefixedOutputVFS.java b/sched/src/com/android/sched/vfs/PrefixedOutputVFS.java
index 1b116be7..92621f36 100644
--- a/sched/src/com/android/sched/vfs/PrefixedOutputVFS.java
+++ b/sched/src/com/android/sched/vfs/PrefixedOutputVFS.java
@@ -18,7 +18,7 @@ package com.android.sched.vfs;
import com.android.sched.util.file.CannotCreateFileException;
import com.android.sched.util.file.NoSuchFileException;
-import com.android.sched.util.file.NotFileOrDirectoryException;
+import com.android.sched.util.file.NotDirectoryException;
import com.android.sched.util.location.Location;
import javax.annotation.Nonnull;
@@ -30,7 +30,7 @@ import javax.annotation.Nonnull;
public class PrefixedOutputVFS extends AbstractOutputVFS {
public PrefixedOutputVFS(@Nonnull InputOutputVFS outputVFS, @Nonnull VPath path)
- throws NotFileOrDirectoryException, CannotCreateFileException {
+ throws NotDirectoryException, CannotCreateFileException {
InputOutputVDir previousRootDir = outputVFS.getRootInputOutputVDir();
OutputVDir newRootDir = null;
try {