aspose file tools*
The moose likes Beginning Java and the fly likes getresource path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "getresource path" Watch "getresource path" New topic
Author

getresource path

Jorge Sereno
Greenhorn

Joined: Jun 30, 2012
Posts: 9
Hi
Where is the path the method

looks for.

Thankx
Jorge Sereno
Greenhorn

Joined: Jun 30, 2012
Posts: 9
Specifying,
how can i define the global path for the method looks for?

Example.
A structure like
src
--pt.ts1
----Main.java
--pt.ts2
----MainTest.java
resources
--file.txt

when i use somewhere in the app looks for the path resources/file.txt.
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

First of all, I would suggest you read HowToAskQuestionsOnJavaRanch FAQ.

As for your problem, to access root directory (package) in src you add forward slash at the beginning of your String. Further it's the matter of your package structure:


Also note that Java is case sensitive so there are no methods getclass() or getresource().


The quieter you are, the more you are able to hear.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getresource path