private void traverse(String dir, int ctr) throws IOException
{
// get current file and name
File myFile = new File(dir);
System.out.println("dir path: " + myFile.getAbsolutePath()); ...
|
I'm trying to implement the following operation in Java and am not sure how:
/*
* write data (Data is defined in my package)
* to a file only if it does ...
|
I am joining a competition that requires me to put all my java classes in one single .java file. Does there exist a tool that does this for me (including changing ... |
String filename1; //file name to write to
//get the file name to write to ...
|
Hi, I wonder if anyone can help me on this EOF matter. Is there a general EOF check? I've read some other people's replies saying that there is a different check for different reading methods. I've got a test function below which just prints the output of the file on the screen (one char at a time, without spaces), but after ... |
hi i created a method that will create a file in spacific path .. no i close the app and reopen it , now i want check if the file exists or not , i know there is a method in File class exists()-boolean but this method will not allow me to choose the path ?? coz i think it will ... |
hi, I have been having a problem in finding the best method in th JDK which can enable me to hide files in the system. the method which i can locate are for checking whether the file is hiden and the delete() method. can you please help me with the code to hide files in java. thanks. |
|
Wasn't sure what to put in the subject line... Essentially, I have my program working so that, when a user opens a new file, it'll simply say, "Oh hey, there is a file open, perhaps he should save it." As of right now, as long as the user has set about editing the file (literally clicked a button saying "I am ... |
i am trying to create a project file from existing main files , i create my project file(FixedDeposit) where other files are kept i want to add, and i use the option add existing file and add all the files i want to add. And i make the main of other files comment and try to call them in main of ... |
import java.io.File; import java.net.URI; import java.net.URISyntaxException; public class TestFiles { public static void main(String args[]) throws URISyntaxException { //These two lines do not work, but the paths are correct and the files exist. //File source = new File(new URI("file:///Volumes/public/buzzer.wmv")); //File source = new File("/Users/tanner/Desktop/buzzer.wmv"); //This line works. File source = new File("TestFiles.java"); System.out.println("Exists: "+source.exists()); } } |
Hi there. So, i have some text writeen on a textpane and now i want to save it as a document but my problem is how to know if the file is already saved or not on the disc. If the file is already on it i just want to "update" it and if it's not i want to create the ... |
Works fine for me. Maybe you spelled the file name wrong. Maybe your Explorer settings are "Don't show system files", and that is a system file and that setting affects a library that Java also uses. Maybe the user that you're logged in as doesn't have permissions to see that file. File.exists() works, but its behavior is affected by the underlying ... |
|
fedevaps wrote: Yes I thought of that, but maybe there was a way to force the move? Think about it. What does "force the move" actually mean? It means nothing else than deleting the destination file and moving the source file to where the destination was. If the "renameTo()" method had another argument (let's say "boolean force") that would do nothing ... |
|
|
|
Wild axx guessing here, but the debugger has the class files, and at some point generates the .jad files from those class files. (A .jad file is just a text file of the source code for that class - or at least a guess at the source code), then some other process is trying to read that file, and for some ... |