Created
May 13, 2015 14:56
-
-
Save barik/fcfde98639d9361bdf5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static boolean isParentOf(char[] folderName, char[] fileName) { | |
if (folderName.length >= fileName.length) { | |
return false; | |
} | |
if (fileName[folderName.length] != '\\' && fileName[folderName.length] != '/') { | |
return false; | |
} | |
for (int i = folderName.length - 1; i >= 0; i--) { | |
if (folderName[i] != fileName[i]) { | |
return false; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment