Skip to content

Commit

Permalink
Use generic java.nio.files interfaces in FileSystemStorage #21
Browse files Browse the repository at this point in the history
  • Loading branch information
atomashpolskiy committed Aug 7, 2017
1 parent 2c5a9f2 commit 2bca9cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 3 additions & 1 deletion bt-core/src/main/java/bt/data/file/FileSystemStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ public class FileSystemStorage implements Storage {
*
* @param rootDirectory Root directory for this storage. All torrent files will be stored inside this directory.
* @since 1.0
* @deprecated since 1.3 in favor of more generic {@link #FileSystemStorage(Path)}
*/
@Deprecated public FileSystemStorage(File rootDirectory) {
@Deprecated
public FileSystemStorage(File rootDirectory) {
this(rootDirectory.toPath());
}

Expand Down
4 changes: 2 additions & 2 deletions bt-core/src/main/java/bt/data/file/FileSystemStorageUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public long size() {

@Override
public String toString() {
return "(" + capacity + " B) " + file.getRoot();
return "(" + capacity + " B) " + file;
}

@Override
Expand All @@ -199,7 +199,7 @@ public void close() throws IOException {
try {
sbc.close();
} catch (IOException e) {
LOGGER.warn("Failed to close file: " + file.getRoot(), e);
LOGGER.warn("Failed to close file: " + file, e);
} finally {
closed = true;
}
Expand Down
3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<name>Andrei Tomashpolskiy</name>
<email>nordmann89@gmail.com</email>
</developer>
</developers>

<developers>
<developer>
<id>MorrisLaw</id>
<name>Jeremy L. Morris</name>
Expand Down

0 comments on commit 2bca9cc

Please sign in to comment.