|
|
|
@ -89,7 +89,8 @@ public class FlatFileTaskCollection<T> implements TaskCollection<T> { |
|
|
|
|
StandardOpenOption.WRITE, |
|
|
|
|
StandardOpenOption.CREATE); |
|
|
|
|
} catch (final IOException e) { |
|
|
|
|
throw new StorageException(e); |
|
|
|
|
throw new StorageException( |
|
|
|
|
"There was a problem opening FileChannel " + pathForFileNumber(fileNumber), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -106,7 +107,8 @@ public class FlatFileTaskCollection<T> implements TaskCollection<T> { |
|
|
|
|
writeFileChannel = openWriteFileChannel(writeFileNumber); |
|
|
|
|
} |
|
|
|
|
} catch (final IOException e) { |
|
|
|
|
throw new StorageException(e); |
|
|
|
|
throw new StorageException( |
|
|
|
|
"There was a problem adding to FileChannel " + pathForFileNumber(writeFileNumber), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -123,7 +125,8 @@ public class FlatFileTaskCollection<T> implements TaskCollection<T> { |
|
|
|
|
size--; |
|
|
|
|
return task; |
|
|
|
|
} catch (final IOException e) { |
|
|
|
|
throw new StorageException(e); |
|
|
|
|
throw new StorageException( |
|
|
|
|
"There was a problem removing from FileChannel " + pathForFileNumber(readFileNumber), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -249,6 +252,10 @@ public class FlatFileTaskCollection<T> implements TaskCollection<T> { |
|
|
|
|
StorageException(final Throwable t) { |
|
|
|
|
super(t); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
StorageException(final String m, final Throwable t) { |
|
|
|
|
super(m, t); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static class FlatFileTask<T> implements Task<T> { |
|
|
|
|