I'm trying to create a folder with a certain name but I do not know why bin + name always appears.
Example: If secondArg = point then the folder name becomes binpoint.
Is it because I'm running at the terminal? Since when I run the terminal I have to go to the project folder and then to the bin in order to execute the class. How can I resolve?
private void makeDir(String secondArg) {
File theDir = new File(System.getProperty("user.dir") + secondArg);
// if the directory does not exist, create it
if (!theDir.exists()) {
System.out.println("creating directory: " + theDir.getName());
boolean result = false;
try{
theDir.mkdir();
result = true;
}
catch(SecurityException se){
//handle it
}
if(result) {
System.out.println("Repository " + theDir.getName() + " was been created");
}
}
}