Skip to content

Commit

Permalink
Add IFSFile convenience methods: isInQOpenSys() and isInQsys()
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Gorzinski <[email protected]>
  • Loading branch information
ThePrez committed Mar 22, 2024
1 parent 98e74fa commit b9ffed6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/com/ibm/as400/access/IFSFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,22 @@ public String getSubtype()
}
return subType_;
}
private boolean isInFileSystem(String _fs) {
String lowercasePath = path_.toLowerCase().replaceAll("//+","/");
return lowercasePath.equals("/"+_fs.toLowerCase()) || lowercasePath.startsWith("/"+_fs.toLowerCase()+"/");

}

public boolean isInQOpenSys() {
return isInFileSystem("QOpenSys");
}

public boolean isInQsys() {
return isInFileSystem("qsys.lib");
}
public boolean isInQDLS() {
return isInFileSystem("qdls");
}

/**
Determines if the file is an IBM i "source physical file".
Expand Down

0 comments on commit b9ffed6

Please sign in to comment.