Skip to content

Commit

Permalink
fix(drives): manage exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelje authored and Hector Rondon committed Jan 18, 2018
1 parent 6dcbf0b commit 4cbde3b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions inventory/src/main/java/org/flyve/inventory/categories/Drives.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,22 @@ public Drives(Context xCtx) {
*/
private void addStorage(File f) {

Category c = new Category("DRIVES", "drives");
try {
Category c = new Category("DRIVES", "drives");

c.put("VOLUMN", new CategoryValue(getVolumn(f), "VOLUMN", "path"));
c.put("TOTAL", new CategoryValue(getTotal(f), "TOTAL", "total"));
c.put("FREE", new CategoryValue(getFree(f), "FREE", "free"));
c.put("VOLUMN", new CategoryValue(getVolumn(f), "VOLUMN", "path"));
c.put("TOTAL", new CategoryValue(getTotal(f), "TOTAL", "total"));
c.put("FREE", new CategoryValue(getFree(f), "FREE", "free"));

this.add(c);
this.add(c);
} catch (Exception ex) {
FILog.e(ex.getMessage());
}
}

/**
* Get the volume of the storage
* @param File f
* @param f file
* @return string with the volume
*/
public String getVolumn(File f) {
Expand All @@ -108,7 +112,7 @@ public String getVolumn(File f) {

/**
* Get the total space of the drive
* @param File f
* @param f file
* @return string the total space
*/
public String getTotal(File f) {
Expand All @@ -127,7 +131,7 @@ public String getTotal(File f) {

/**
* Get the free space of the drive
* @param File f
* @param f file
* @return string the free space
*/
public String getFree(File f) {
Expand Down

0 comments on commit 4cbde3b

Please sign in to comment.