Skip to content

Commit

Permalink
simplified getCachedFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
sadib100 committed Mar 6, 2018
1 parent 54c7b25 commit 58d2085
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/java/edu/sjsu/cs249/project1/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,12 @@ public void readFiles(byte[] data) {
* @return
*/
public File getCachedFile(String fileName){
if (this.fileMap.containsKey(fileName)) {
if (this.fileMap.get(fileName).getValidStatus()){
return this.fileMap.get(fileName);
} else {
return null;
}
if (this.fileMap.containsKey(fileName) && this.fileMap.get(fileName).getValidStatus()) {
return this.fileMap.get(fileName);
} else {
return null;
}
}
}

/**
* Delete a file with given name and remove local cache if present.
Expand Down

0 comments on commit 58d2085

Please sign in to comment.