Skip to content

Commit

Permalink
Improvements for Showing Storage Info
Browse files Browse the repository at this point in the history
  • Loading branch information
amitjoy committed Jul 13, 2023
1 parent 53affba commit 47eb5d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ private static long getStorageSize(final Bundle bundle) {
final String bsn = bundle.getSymbolicName();
if (bundleContext == null) {
logger.atDebug().msg("Bundle context is null for '{}'").arg(bsn).log();
return -1;
return -1L;
}
final File storage = bundleContext.getDataFile("");
if (storage == null) {
logger.atDebug().msg("Bundle storage is null for '{}'").arg(bsn).log();
return -1;
return -1L;
}
return storage.length();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ private String formatLastModified(final long lastModified) {
}

private String humanReadableByteCount(long bytes) {
if (bytes == -1) {
return "<IGNORED>";
}
if (-1000 < bytes && bytes < 1000) {
return bytes + " B";
}
Expand Down

0 comments on commit 47eb5d0

Please sign in to comment.