hello everyone,
i would like to ask a question about folders
how can i make a new folder in any directory
and also how can i copy, cut, and paste this folder
and also how can i copy, cut and paste files :)
thx
Printable View
hello everyone,
i would like to ask a question about folders
how can i make a new folder in any directory
and also how can i copy, cut, and paste this folder
and also how can i copy, cut and paste files :)
thx
Umm. Is this a Java question?
If so, a very good place to get ideas that might be useful in your code would be the File API documentation.
thanks for replying and yes it's a Java question
i am working on Java project
in my class but i am a begginer to Java so i might asking the ques. in the wrong way
mainly i want to make a folder (the same as the one of the windows) to save some files in it
is this available in Java ?
and if so how can i do it or what class would help me ?
This may be to late but
To make a directory
To move a file and rename itCode:File f = new File("C:\\Users\\Admin\\Desktop\\javaprojects\\FolderName");
f.mkdir(); // makes folder/directory
Hope this helps although I suspect you may have the answer by now.Code:File a = new File ("C:\\Users\\Admin\\Desktop\\BmiAssignment_Notes\\mbrshipFiles\\FileToCopy.txt");
a.renameTo(new File("C:\\Users\\Admin\\Desktop\\javaprojects\\collegeSamples\\homework\\Assessment3Bmi\\build\\classes\\assessment3bmi\\mbrshipFiles\\FileNewName.txt"));
np, glad I could help someone, I feel that I may have repaid a little of the help that I have had over last couple of months.
:D