MCPcopy Create free account
hub / github.com/PCGen/pcgen / isPCGenCharacterOrPartyFile

Method isPCGenCharacterOrPartyFile

code/src/java/pcgen/io/PCGFile.java:147–158  ·  view source on GitHub ↗

Checks if the given file is a PCGen character or party file based on the file extension. @param file the file to test @return {true} if a PCGen character or party file @see Constants#EXTENSION_CHARACTER_FILE @see Constants#EXTENSION_PARTY_FILE

(final File file)

Source from the content-addressed store, hash-verified

145 * @see Constants#EXTENSION_PARTY_FILE
146 */
147 public static boolean isPCGenCharacterOrPartyFile(final File file)
148 {
149 // A directory strangely named "fred.pcg" is not a character file.
150 if (file.isDirectory())
151 {
152 return false;
153 }
154
155 final String name = getWindowsSafeFilename(file);
156
157 return name.endsWith(Constants.EXTENSION_CHARACTER_FILE) || name.endsWith(Constants.EXTENSION_PARTY_FILE);
158 }
159
160 /**
161 * It may turn out to be the case that this should be optimized further to

Callers 3

testIsPCGenPartyFileMethod · 0.95
testIsPCGenLstFileMethod · 0.95

Calls 1

Tested by 3

testIsPCGenPartyFileMethod · 0.76
testIsPCGenLstFileMethod · 0.76