verify if the class name contains only letters and digits the path of the new project is a directory
(String className, String pathNewProject)
| 480 | * the path of the new project is a directory |
| 481 | */ |
| 482 | public void verifyInput(String className, String pathNewProject) |
| 483 | throws GateException { |
| 484 | // verify the input |
| 485 | // class name contains only letters and digits |
| 486 | char[] classNameChars = className.toCharArray(); |
| 487 | for (int i=0;i<classNameChars.length;i++){ |
| 488 | if (!Character.isLetterOrDigit(classNameChars[i])) |
| 489 | throw new GateException("Only letters and digits in the class name"); |
| 490 | } |
| 491 | |
| 492 | // verify if it exits a directory of given path |
| 493 | File dir = new File(pathNewProject); |
| 494 | if (!dir.isDirectory()) |
| 495 | throw new GateException("The folder is not a directory"); |
| 496 | } |
| 497 | |
| 498 | /***/ |
| 499 | public void executableFile(String nameFile) |