commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [VFS] Support for File System Roots?
Date Fri, 28 Dec 2012 20:35:10 GMT
I think the question should be considered with regard to how each OS
deals with this. IIRC Java has a get roots API. I am on my phone ATM
and cannot dig in.

Gary

On Dec 28, 2012, at 15:05, Mark Fortner <phidias51@gmail.com> wrote:

> Hi Gary,
> Good question.  There would need to be some OS version checking to
> determine which directory to return.  I seem to recall that older versions
> of Windows had a C:\Documents and Settings folder or something like that.
> Currently, I use Spring to config these directories (rather than hard
> coding them).  What would be the appropriate Commons VFS way of dealing
> with this?  An abstract factory method perhaps with hard coded factories
> per OS + version?
>
> Cheers,
>
> Mark
>
>
>
> On Fri, Dec 28, 2012 at 11:57 AM, Gary Gregory <garydgregory@gmail.com>wrote:
>
>> Hi,
>>
>> Ok, patches welcome! :)
>>
>> What happens if there is a c:\Documents folder?
>>
>> Gary
>>
>> On Dec 28, 2012, at 14:54, Mark Fortner <phidias51@gmail.com> wrote:
>>
>>> Hi Gary,
>>> This would be per operating system.  So, if I call
>>> *RootFactory.getRoot(RootNames.HOME)
>>> *from a Linux box, that would resolve to */home/<username>*, on a Windows
>>> box that might be */Users/<username>*.  It would be driven by the *
>>> System.getProperty("user.home")* variable.  The other roots, are OS
>>> dependent and are subdirectories of the home directory.  You might also
>>> have another method like *getRoot(RootNames.HOME, OS.LINUX)* that would
>> let
>>> you get the value for Linux, even if you aren't on a Linux box.
>>>
>>> The URIs might look like "/Documents" which would resolve to
>>> "file:///home/<username>/Documents".
>>>
>>> This came up because I'm reworking a Swing file manager using JavaFX and
>> I
>>> wanted to clean up the API some and minimize any VFS specific
>> workarounds I
>>> was doing.
>>>
>>> Cheers,
>>>
>>> Mark
>>>
>>>
>>>
>>> On Fri, Dec 28, 2012 at 11:42 AM, Gary Gregory <garydgregory@gmail.com
>>> wrote:
>>>
>>>> Would this only be for Windows? What do URIs look like?
>>>>
>>>> Gary
>>>>
>>>> On Dec 28, 2012, at 14:18, Mark Fortner <phidias51@gmail.com> wrote:
>>>>
>>>>> I was wondering if there were any plans (or currently any way) to
>> support
>>>>> File System Roots.  In addition to the standard sorts of roots, there
>> are
>>>>> roots like your home directory, the Documents, Photos, Music,
>> Downloads,
>>>>> etc.
>>>>>
>>>>> At a minimum it would be useful to have an Enum of the different
>>>> directory
>>>>> names, with some way of resolving them.  Something like:
>>>>>
>>>>> FileObject root = RootFactory.getRoot(RootNames.HOME);
>>>>>
>>>>> and
>>>>>
>>>>> Map<String, FileObject> rootMap = RootFactory.getRoots();
>>>>>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Mark
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message