[VFS] Support for File System Roots?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[VFS] Support for File System Roots?

Mark Fortner-3
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
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

garydgregory
Would this only be for Windows? What do URIs look like?

Gary

On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

Mark Fortner-3
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 <[hidden email]>wrote:

> Would this only be for Windows? What do URIs look like?
>
> Gary
>
> On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

garydgregory
Hi,

Ok, patches welcome! :)

What happens if there is a c:\Documents folder?

Gary

On Dec 28, 2012, at 14:54, Mark Fortner <[hidden email]> 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 <[hidden email]>wrote:
>
>> Would this only be for Windows? What do URIs look like?
>>
>> Gary
>>
>> On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

Mark Fortner-3
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 <[hidden email]>wrote:

> Hi,
>
> Ok, patches welcome! :)
>
> What happens if there is a c:\Documents folder?
>
> Gary
>
> On Dec 28, 2012, at 14:54, Mark Fortner <[hidden email]> 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 <[hidden email]
> >wrote:
> >
> >> Would this only be for Windows? What do URIs look like?
> >>
> >> Gary
> >>
> >> On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

garydgregory
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 <[hidden email]> 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 <[hidden email]>wrote:
>
>> Hi,
>>
>> Ok, patches welcome! :)
>>
>> What happens if there is a c:\Documents folder?
>>
>> Gary
>>
>> On Dec 28, 2012, at 14:54, Mark Fortner <[hidden email]> 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 <[hidden email]
>>> wrote:
>>>
>>>> Would this only be for Windows? What do URIs look like?
>>>>
>>>> Gary
>>>>
>>>> On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [VFS] Support for File System Roots?

Roger Whitcomb
In reply to this post by Mark Fortner-3
I'm actually working on a similar project to make a new version of the
Apache Pivot File Browser to use VFS.  So, I'd also be interested to see
what suggestions the developers here have.  

~Roger Whitcomb

-----Original Message-----
From: Mark Fortner [mailto:[hidden email]]
Sent: Friday, December 28, 2012 11:54 AM
To: Commons Developers List
Subject: Re: [VFS] Support for File System Roots?

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
<[hidden email]>wrote:

> Would this only be for Windows? What do URIs look like?
>
> Gary
>
> On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

Mark Fortner-3
Gary,
The File#getRoots() method that you mentioned gets the file system roots
and not user-specific directories like Documents, Downloads, Photos, Music,
etc.

I ended up creating a solution with maps of directories for each operating
system (or relevant OS version in the case of Windows).  I also implemented
a solution for resolving "~" as the home directory in URLs.  I can check
these into my project and send you the URLs for the files if you're
interested.

Cheers,

Mark



On Sun, Jan 6, 2013 at 3:18 PM, Roger L. Whitcomb <[hidden email]
> wrote:

> I'm actually working on a similar project to make a new version of the
> Apache Pivot File Browser to use VFS.  So, I'd also be interested to see
> what suggestions the developers here have.
>
> ~Roger Whitcomb
>
> -----Original Message-----
> From: Mark Fortner [mailto:[hidden email]]
> Sent: Friday, December 28, 2012 11:54 AM
> To: Commons Developers List
> Subject: Re: [VFS] Support for File System Roots?
>
> 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
> <[hidden email]>wrote:
>
> > Would this only be for Windows? What do URIs look like?
> >
> > Gary
> >
> > On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

Mark Fortner-3
Sorry, that should have read *FileSystem.listRoots()*.

Cheers,

Mark



On Sun, Jan 6, 2013 at 4:50 PM, Mark Fortner <[hidden email]> wrote:

> Gary,
> The File#getRoots() method that you mentioned gets the file system roots
> and not user-specific directories like Documents, Downloads, Photos, Music,
> etc.
>
> I ended up creating a solution with maps of directories for each operating
> system (or relevant OS version in the case of Windows).  I also implemented
> a solution for resolving "~" as the home directory in URLs.  I can check
> these into my project and send you the URLs for the files if you're
> interested.
>
> Cheers,
>
> Mark
>
>
>
> On Sun, Jan 6, 2013 at 3:18 PM, Roger L. Whitcomb <
> [hidden email]> wrote:
>
>> I'm actually working on a similar project to make a new version of the
>> Apache Pivot File Browser to use VFS.  So, I'd also be interested to see
>> what suggestions the developers here have.
>>
>> ~Roger Whitcomb
>>
>> -----Original Message-----
>> From: Mark Fortner [mailto:[hidden email]]
>> Sent: Friday, December 28, 2012 11:54 AM
>> To: Commons Developers List
>> Subject: Re: [VFS] Support for File System Roots?
>>
>> 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
>> <[hidden email]>wrote:
>>
>> > Would this only be for Windows? What do URIs look like?
>> >
>> > Gary
>> >
>> > On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
>> > For additional commands, e-mail: [hidden email]
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

garydgregory
In reply to this post by Mark Fortner-3
Ok, that sounds interesting. Can you give us some examples? I sounds like
it makes sense for file:// only. Did you have it in mind for other file
systems?

Should the treatment of '~' be optional? Is there a chance of it being
confused with any kind of legal file reference on any OS?

Gary


On Sun, Jan 6, 2013 at 7:50 PM, Mark Fortner <[hidden email]> wrote:

> Gary,
> The File#getRoots() method that you mentioned gets the file system roots
> and not user-specific directories like Documents, Downloads, Photos, Music,
> etc.
>
> I ended up creating a solution with maps of directories for each operating
> system (or relevant OS version in the case of Windows).  I also implemented
> a solution for resolving "~" as the home directory in URLs.  I can check
> these into my project and send you the URLs for the files if you're
> interested.
>
> Cheers,
>
> Mark
>
>
>
> On Sun, Jan 6, 2013 at 3:18 PM, Roger L. Whitcomb <
> [hidden email]
> > wrote:
>
> > I'm actually working on a similar project to make a new version of the
> > Apache Pivot File Browser to use VFS.  So, I'd also be interested to see
> > what suggestions the developers here have.
> >
> > ~Roger Whitcomb
> >
> > -----Original Message-----
> > From: Mark Fortner [mailto:[hidden email]]
> > Sent: Friday, December 28, 2012 11:54 AM
> > To: Commons Developers List
> > Subject: Re: [VFS] Support for File System Roots?
> >
> > 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
> > <[hidden email]>wrote:
> >
> > > Would this only be for Windows? What do URIs look like?
> > >
> > > Gary
> > >
> > > On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>



--
E-Mail: [hidden email] | [hidden email]
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

Mark Fortner-3
Gary,
I'm not aware of the tilde being used for any other purpose in any other
file system. If a user had specified a directory like "~/mu~noz" as a home
directory it should resolve to the appropriate directory i.e. "<User
Home>/mu~noz".

As for it being optional on a per file system basis, I suppose that's
possible. Is there a way of storing/registering file system configurations
(ala Spring Context)?

I hadn't really thought about it's use for other file systems.  Merely for
use with the local file system.  How would you use this in a distributed
file system?  What would happen if the remote file system did not have a
home directory (or equivalent) for the current user?

Mark

Cheers,

Mark



On Sun, Jan 6, 2013 at 10:24 PM, Gary Gregory <[hidden email]>wrote:

> Ok, that sounds interesting. Can you give us some examples? I sounds like
> it makes sense for file:// only. Did you have it in mind for other file
> systems?
>
> Should the treatment of '~' be optional? Is there a chance of it being
> confused with any kind of legal file reference on any OS?
>
> Gary
>
>
> On Sun, Jan 6, 2013 at 7:50 PM, Mark Fortner <[hidden email]> wrote:
>
> > Gary,
> > The File#getRoots() method that you mentioned gets the file system roots
> > and not user-specific directories like Documents, Downloads, Photos,
> Music,
> > etc.
> >
> > I ended up creating a solution with maps of directories for each
> operating
> > system (or relevant OS version in the case of Windows).  I also
> implemented
> > a solution for resolving "~" as the home directory in URLs.  I can check
> > these into my project and send you the URLs for the files if you're
> > interested.
> >
> > Cheers,
> >
> > Mark
> >
> >
> >
> > On Sun, Jan 6, 2013 at 3:18 PM, Roger L. Whitcomb <
> > [hidden email]
> > > wrote:
> >
> > > I'm actually working on a similar project to make a new version of the
> > > Apache Pivot File Browser to use VFS.  So, I'd also be interested to
> see
> > > what suggestions the developers here have.
> > >
> > > ~Roger Whitcomb
> > >
> > > -----Original Message-----
> > > From: Mark Fortner [mailto:[hidden email]]
> > > Sent: Friday, December 28, 2012 11:54 AM
> > > To: Commons Developers List
> > > Subject: Re: [VFS] Support for File System Roots?
> > >
> > > 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
> > > <[hidden email]>wrote:
> > >
> > > > Would this only be for Windows? What do URIs look like?
> > > >
> > > > Gary
> > > >
> > > > On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]> 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: [hidden email]
> > > > For additional commands, e-mail: [hidden email]
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
>
>
>
> --
> E-Mail: [hidden email] | [hidden email]
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
Reply | Threaded
Open this post in threaded view
|

RE: [VFS] Support for File System Roots?

Roger Whitcomb
I'm still interested in this.  I can see the idea of multiple roots
being useful in an SMB file system, or local (Windows) file systems.  Of
course, for others there would only be a single "root" (namely "/").
I'm writing a custom provider which could be pointing to either Linux or
Windows.  Would it make sense to have a "getRoots" method in
FileProvider?

        public FileName[] getRoots();

or possibly:

        public FileObject[] getRoots();

which by default just returns a single entry with a path of "/"...  Then
the default (local) file system provider would just return the results
of File.listRoots();

Then, Mark's idea of using an enum to get other user-relative
directories could also be (sort of) accommodated with a "getUserRoot()"
which returns the equivalent of "~" on *nix or OSX, and %USERPROFILE% on
Windows (Java "user.home") property.

The reason I think this is necessary is that, in order to do browsing of
all the files in a system, you need to be able to get to all the
relevant top-level locations.  And for Samba (for a non-obvious
example), there typically will be multiple shared folders on a system
that you might want to pick from.

I can probably provide a patch by next week.  Should I write up a JIRA?

~Roger Whitcomb


-----Original Message-----
From: Mark Fortner [mailto:[hidden email]]
Sent: Friday, February 08, 2013 4:07 PM
To: Commons Developers List
Subject: Re: [VFS] Support for File System Roots?

Gary,
I'm not aware of the tilde being used for any other purpose in any other
file system. If a user had specified a directory like "~/mu~noz" as a
home directory it should resolve to the appropriate directory i.e.
"<User
Home>/mu~noz".

As for it being optional on a per file system basis, I suppose that's
possible. Is there a way of storing/registering file system
configurations (ala Spring Context)?

I hadn't really thought about it's use for other file systems.  Merely
for use with the local file system.  How would you use this in a
distributed file system?  What would happen if the remote file system
did not have a home directory (or equivalent) for the current user?

Mark

Cheers,

Mark



On Sun, Jan 6, 2013 at 10:24 PM, Gary Gregory
<[hidden email]>wrote:

> Ok, that sounds interesting. Can you give us some examples? I sounds
> like it makes sense for file:// only. Did you have it in mind for
> other file systems?
>
> Should the treatment of '~' be optional? Is there a chance of it being

> confused with any kind of legal file reference on any OS?
>
> Gary
>
>
> On Sun, Jan 6, 2013 at 7:50 PM, Mark Fortner <[hidden email]>
wrote:

>
> > Gary,
> > The File#getRoots() method that you mentioned gets the file system
> > roots and not user-specific directories like Documents, Downloads,
> > Photos,
> Music,
> > etc.
> >
> > I ended up creating a solution with maps of directories for each
> operating
> > system (or relevant OS version in the case of Windows).  I also
> implemented
> > a solution for resolving "~" as the home directory in URLs.  I can
> > check these into my project and send you the URLs for the files if
> > you're interested.
> >
> > Cheers,
> >
> > Mark
> >
> >
> >
> > On Sun, Jan 6, 2013 at 3:18 PM, Roger L. Whitcomb <
> > [hidden email]
> > > wrote:
> >
> > > I'm actually working on a similar project to make a new version of

> > > the Apache Pivot File Browser to use VFS.  So, I'd also be
> > > interested to
> see
> > > what suggestions the developers here have.
> > >
> > > ~Roger Whitcomb
> > >
> > > -----Original Message-----
> > > From: Mark Fortner [mailto:[hidden email]]
> > > Sent: Friday, December 28, 2012 11:54 AM
> > > To: Commons Developers List
> > > Subject: Re: [VFS] Support for File System Roots?
> > >
> > > 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
> > > <[hidden email]>wrote:
> > >
> > > > Would this only be for Windows? What do URIs look like?
> > > >
> > > > Gary
> > > >
> > > > On Dec 28, 2012, at 14:18, Mark Fortner <[hidden email]>
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: [hidden email]
> > > > For additional commands, e-mail: [hidden email]
> > > >
> > > >
> > >
> > > ------------------------------------------------------------------
> > > --- To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
>
>
>
> --
> E-Mail: [hidden email] | [hidden email] JUnit in Action,
> 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [VFS] Support for File System Roots?

Bernd Eckenfels
Am 28.08.2013, 00:36 Uhr, schrieb Roger L. Whitcomb  
<[hidden email]>:
> The reason I think this is necessary is that, in order to do browsing of
> all the files in a system, you need to be able to get to all the
> relevant top-level locations.  And for Samba (for a non-obvious
> example), there typically will be multiple shared folders on a system
> that you might want to pick from.

I also can imagine some providers having multiple instances (for example  
two ram filesystems). Today I think this can only be done with different  
schema prefix ram1: and ram2: or with having a instance in the fsoptions.  
But in both cases a enumeration of those different instances is not yet  
supported without the root getter.

Gruss
Bernd

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [VFS] Support for File System Roots?

Roger Whitcomb
So, it seems like putting the method in the FileProvider interface is
the right place for it?!

~Roger


-----Original Message-----
From: Bernd Eckenfels [mailto:[hidden email]]
Sent: Tuesday, August 27, 2013 3:53 PM
To: Commons Developers List
Subject: Re: [VFS] Support for File System Roots?

Am 28.08.2013, 00:36 Uhr, schrieb Roger L. Whitcomb
<[hidden email]>:
> The reason I think this is necessary is that, in order to do browsing
> of all the files in a system, you need to be able to get to all the
> relevant top-level locations.  And for Samba (for a non-obvious
> example), there typically will be multiple shared folders on a system
> that you might want to pick from.

I also can imagine some providers having multiple instances (for example
two ram filesystems). Today I think this can only be done with different
schema prefix ram1: and ram2: or with having a instance in the
fsoptions.  
But in both cases a enumeration of those different instances is not yet
supported without the root getter.

Gruss
Bernd

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]