[Biojava-dev] File path problem
Andreas Prlic
andreas.prlic at gmail.com
Tue Sep 8 16:47:37 UTC 2009
Another work around is to use symbolic links...
The standard way to request files form the file system in biojava is like this:
String resName = "org/biojava/bio/program/sax/blastxml/input.xml";
InputStream resStream =
getClass().getClassLoader().getResourceAsStream(resName);
Not sure if this will work with spaces in directory names....
Andreas
On Tue, Sep 8, 2009 at 9:08 AM, Mark Fortner<phidias51 at gmail.com> wrote:
> Andreas & Andy,
> AFAIK this is a long-standing JVM/OS dependent issue. The only workaround I
> know of is to escape the spaces by preceding them with a backslash.
>
> You may be able to create a relative root directory from which all other
> subdirectories can be resolved. Andy, do you encounter a problem if you do
> something like this:
>
> File biojavaHome = new File(".");
>
> in the ~/Desktop/No Time Machine Backup/biojava directory? Does
> biojavaHome.exists() return true?
>
> If you don't, then it may be able to resolve subdirectories of the
> biojavaHome file object. You might also try to declare a biojava home env
> variable and use it throughout the unit tests.
>
> The other thing that you might try is the new File(new URI("blah"))
> constructor. According to the URI javadoc it apparently can deal with %20
> spaces in file names.
>
> Hope this helps,
>
> Mark
>
> On Tue, Sep 8, 2009 at 2:43 AM, Andy Law (RI) <andy.law at roslin.ed.ac.uk>
> wrote:
>>
>> On 7 Sep 2009, at 21:03, Andreas Prlic wrote:
>>
>>> Hi Andy,
>>>
>>> Can you send me a few stacktraces / file locations that you are having
>>> problems with? works fine for me on OSX using eclipse and command line
>>> mvn...
>>>
>>
>>
>>
>> http://tr.im/y8YT
>>
>>
>> I have lots like this (generated from the command line).
>>
>> If I move the biojava folder to the Desktop (i.e. at "~/Desktop/biojava/"
>> rather than "~/Desktop/No Time Machine Backup/biojava/") then the problem
>> goes away.
>>
>>
>>
>> Later,
>>
>> Andy
>> --------
>> Yada, yada, yada...
>> The University of Edinburgh is a charitable body, registered in Scotland,
>> with registration number SC005336
>> Disclaimer: This e-mail and any attachments are confidential and intended
>> solely for the use of the recipient(s) to whom they are addressed. If you
>> have received it in error, please destroy all copies and inform the sender.
>>
>>
>>
>> _______________________________________________
>> biojava-dev mailing list
>> biojava-dev at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biojava-dev
>
>
>
> --
> Mark Fortner
>
> blog: http://feeds.feedburner.com/jroller/ideafactory
>
More information about the biojava-dev
mailing list