1
0
mirror of https://github.com/square/okhttp.git synced 2025-08-08 23:42:08 +03:00

Removed IOException from FileSystem exists method as this should never occur.

This commit is contained in:
Dave Roberge
2016-02-25 16:52:53 -05:00
parent 2c3deaebff
commit aaa41df1e9
4 changed files with 5 additions and 5 deletions

View File

@@ -113,7 +113,7 @@ public final class InMemoryFileSystem implements FileSystem, TestRule {
files.remove(file); files.remove(file);
} }
@Override public boolean exists(File file) throws IOException { @Override public boolean exists(File file) {
return files.containsKey(file); return files.containsKey(file);
} }

View File

@@ -1443,7 +1443,7 @@ public final class DiskLruCacheTest {
writeFile(new File(dir2, "otherFile1"), "F"); 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", 0)));
assertFalse(fileSystem.exists(getCleanFile("g1", 1))); assertFalse(fileSystem.exists(getCleanFile("g1", 1)));
assertFalse(fileSystem.exists(getCleanFile("g2", 0))); assertFalse(fileSystem.exists(getCleanFile("g2", 0)));

View File

@@ -68,7 +68,7 @@ public final class FaultyFileSystem implements FileSystem {
delegate.delete(file); delegate.delete(file);
} }
@Override public boolean exists(File file) throws IOException { @Override public boolean exists(File file) {
return delegate.exists(file); return delegate.exists(file);
} }

View File

@@ -71,7 +71,7 @@ public interface FileSystem {
} }
} }
@Override public boolean exists(File file) throws IOException { @Override public boolean exists(File file) {
return file.exists(); return file.exists();
} }
@@ -121,7 +121,7 @@ public interface FileSystem {
void delete(File file) throws IOException; void delete(File file) throws IOException;
/** Returns true if {@code file} exists on the file system. */ /** 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. */ /** Returns the number of bytes stored in {@code file}, or 0 if it does not exist. */
long size(File file); long size(File file);