File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

specifiy a file local in code

 
jite eghagha
Ranch Hand
Posts: 128
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i had this file structure:

Plants
cat.class
 
David McCombs
Ranch Hand
Posts: 212
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what you mean.

Do you mean Plants is a file in the same folder as cat.class, and cat needs to open Plants? Or something else?

If it is the former, you don't need include a file path in the IO class you are using to open it. ie FileReader fr = new FileReader("Plants");

If it is the latter, please post a bit more detail.
 
jite eghagha
Ranch Hand
Posts: 128
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry about that,

animals>
cat.class
dog.class
data.txt

what string points to the bat.txt; i think it looks something like this. (because they're in the same folder)

wolf.getTextFile("..//bat.txt");
[ June 15, 2007: Message edited by: jite eghagha ]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not very clear what you are asking. Can you please explain in more detail what you want to know exactly?

Why not just do this:

wolf.getTextFile("bat.txt");
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic