Skip to content

Commit

Permalink
Removed IOException from FileSystem exists method as this should neve…
Browse files Browse the repository at this point in the history
…r occur.
  • Loading branch information
dave-r12 committed Feb 25, 2016
1 parent 2c3deae commit aaa41df
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private Sink sink(File file, boolean appending) {
files.remove(file);
}

@Override public boolean exists(File file) throws IOException {
@Override public boolean exists(File file) {
return files.containsKey(file);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ private void generateSomeGarbageFiles() throws Exception {
writeFile(new File(dir2, "otherFile1"), "F");
}

private void assertGarbageFilesAllDeleted() throws Exception {
private void assertGarbageFilesAllDeleted() {
assertFalse(fileSystem.exists(getCleanFile("g1", 0)));
assertFalse(fileSystem.exists(getCleanFile("g1", 1)));
assertFalse(fileSystem.exists(getCleanFile("g2", 0)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void setFaultyDelete(File file, boolean faulty) {
delegate.delete(file);
}

@Override public boolean exists(File file) throws IOException {
@Override public boolean exists(File file) {
return delegate.exists(file);
}

Expand Down
4 changes: 2 additions & 2 deletions okhttp/src/main/java/okhttp3/internal/io/FileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public interface FileSystem {
}
}

@Override public boolean exists(File file) throws IOException {
@Override public boolean exists(File file) {
return file.exists();
}

Expand Down Expand Up @@ -121,7 +121,7 @@ public interface FileSystem {
void delete(File file) throws IOException;

/** Returns true if {@code file} exists on the file system. */
boolean exists(File file) throws IOException;
boolean exists(File file);

/** Returns the number of bytes stored in {@code file}, or 0 if it does not exist. */
long size(File file);
Expand Down

0 comments on commit aaa41df

Please sign in to comment.