Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tatic boolean checkExtension(String path) {
- int lastIndex;
- lastIndex = path.length() - 1;
- char[] pathToFile = path.toCharArray();
- if (pathToFile[lastIndex] != 't' || pathToFile[lastIndex - 1] != 'x' ||
- pathToFile[lastIndex - 2] != 't' || pathToFile[lastIndex - 3] != '.') {
- System.out.println("Файл имеет неверное расширение. ");
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement