Re: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-20 Thread Bernd Eckenfels
BTW the Windows directory stream in NIO passes the file meta attributes from 
FindNextFile, it does not have to open/stat the files. Maybe this is the reason 
why it does Not need to resolve them (and it’s generally more efficient than 
using traditional Files.list).


--
http://bernd.eckenfels.net

Von: Gary Gregory 
Gesendet: Friday, November 19, 2021 6:29:25 PM
An: Commons Users List 
Betreff: Re: [io] FileUtils.listFiles activates forces OneDrive files to 
download?

If this is considered a kind of symbolic link, then you could try
passing java.nio.file.LinkOption.NOFOLLOW_LINKS to one of the Commons IO
APIs.

Gary

On Fri, Nov 19, 2021 at 10:49 AM Rod Widdowson 
wrote:

> > It sounds like it is up to OneDrive to do what it pleases when you ask it
> > for a file reference...
>
> FWIW and technically you need to send FILE_FLAG_OPEN_NO_RECALL at the
> Win32 level.  But I am not sure that helps anyone.
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-19 Thread Gary Gregory
More like:

final AccumulatorPathVisitor visitor =
FileUtils.listAccumulate(directory,
FileFileFilter.INSTANCE.and(fileFilter), dirFilter,
PathUtils.EMPTY_FILE_VISIT_OPTION_ARRAY);
return
visitor.getFileList().stream().map(Path::toFile).collect(Collectors.toList());

Gary

On Fri, Nov 19, 2021 at 12:33 PM Gary Gregory 
wrote:

> Like this:
>
> final AccumulatorPathVisitor visitor =
> listAccumulate(directory, FileFileFilter.INSTANCE.and(fileFilter),
> dirFilter, PathUtils.EMPTY_FILE_VISIT_OPTION_ARRAY);
> return
> visitor.getFileList().stream().map(Path::toFile).collect(Collectors.toList());
>
> Gary
>
> On Fri, Nov 19, 2021 at 12:29 PM Gary Gregory 
> wrote:
>
>> If this is considered a kind of symbolic link, then you could try
>> passing java.nio.file.LinkOption.NOFOLLOW_LINKS to one of the Commons IO
>> APIs.
>>
>> Gary
>>
>> On Fri, Nov 19, 2021 at 10:49 AM Rod Widdowson 
>> wrote:
>>
>>> > It sounds like it is up to OneDrive to do what it pleases when you ask
>>> it
>>> > for a file reference...
>>>
>>> FWIW and technically you need to send FILE_FLAG_OPEN_NO_RECALL at the
>>> Win32 level.  But I am not sure that helps anyone.
>>>
>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>>> For additional commands, e-mail: user-h...@commons.apache.org
>>>
>>>


Re: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-19 Thread Gary Gregory
Like this:

final AccumulatorPathVisitor visitor =
listAccumulate(directory, FileFileFilter.INSTANCE.and(fileFilter),
dirFilter, PathUtils.EMPTY_FILE_VISIT_OPTION_ARRAY);
return
visitor.getFileList().stream().map(Path::toFile).collect(Collectors.toList());

Gary

On Fri, Nov 19, 2021 at 12:29 PM Gary Gregory 
wrote:

> If this is considered a kind of symbolic link, then you could try
> passing java.nio.file.LinkOption.NOFOLLOW_LINKS to one of the Commons IO
> APIs.
>
> Gary
>
> On Fri, Nov 19, 2021 at 10:49 AM Rod Widdowson 
> wrote:
>
>> > It sounds like it is up to OneDrive to do what it pleases when you ask
>> it
>> > for a file reference...
>>
>> FWIW and technically you need to send FILE_FLAG_OPEN_NO_RECALL at the
>> Win32 level.  But I am not sure that helps anyone.
>>
>>
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>>


Re: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-19 Thread Gary Gregory
If this is considered a kind of symbolic link, then you could try
passing java.nio.file.LinkOption.NOFOLLOW_LINKS to one of the Commons IO
APIs.

Gary

On Fri, Nov 19, 2021 at 10:49 AM Rod Widdowson 
wrote:

> > It sounds like it is up to OneDrive to do what it pleases when you ask it
> > for a file reference...
>
> FWIW and technically you need to send FILE_FLAG_OPEN_NO_RECALL at the
> Win32 level.  But I am not sure that helps anyone.
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


RE: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-19 Thread blackwelllandis
That does actually help.

Running GraalVM 11.0.12, not sure if it's version or vendor specific.

The cause seems to be NIO itself specifically inside of 
sun.nio.fs.WindowsChannelFactory.open(...).

It doesn't seem to be passing the appropriate flag to 
WindowsNativeDispatcher.CreateFile(...).

-Original Message-
From: Rod Widdowson  
Sent: Friday, November 19, 2021 9:49 AM
To: 'Commons Users List' 
Subject: RE: [io] FileUtils.listFiles activates forces OneDrive files to 
download?

> It sounds like it is up to OneDrive to do what it pleases when you ask 
> it for a file reference...

FWIW and technically you need to send FILE_FLAG_OPEN_NO_RECALL at the Win32 
level.  But I am not sure that helps anyone.




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



RE: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-19 Thread Rod Widdowson
> It sounds like it is up to OneDrive to do what it pleases when you ask it
> for a file reference... 

FWIW and technically you need to send FILE_FLAG_OPEN_NO_RECALL at the Win32 
level.  But I am not sure that helps anyone.




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-19 Thread Gary Gregory
It sounds like it is up to OneDrive to do what it pleases when you ask it
for a file reference... The more recent version of IO uses NIO for some of
this, that might help, or not. Make sure you are using the latest IO to
make it simpler to analyze any findings.

Gary


On Fri, Nov 19, 2021, 10:03  wrote:

> The value of start would be a java.io.File object pointing to any
> directory within c:\Users\{user}\OneDrive\.
>
>
> Landis
>
> -Original Message-
> From: Gary Gregory 
> Sent: Friday, November 19, 2021 8:55 AM
> To: Commons Users List 
> Subject: Re: [io] FileUtils.listFiles activates forces OneDrive files to
> download?
>
> Your example is too vague, what is the value of "start"?
>
> Gary
>
>
> On Fri, Nov 19, 2021, 09:52  wrote:
>
> > Hi,
> >
> >
> >
> > I have a large drive of cloud files in OneDrive that aren't stored
> locally.
> >
> > The following code forces any files traversed to download locally
> > which is not preferable to say the least.
> >
> >
> >
> > https://pastebin.com/hmA0jTLy
> >
> >
> >
> > Is there a particular reason this happens with FileUtils.listFiles and
> > not with java.io.File.listFiles?
> >
> >
> >
> > Thanks
> >
> >
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


RE: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-19 Thread blackwelllandis
The value of start would be a java.io.File object pointing to any directory 
within c:\Users\{user}\OneDrive\.


Landis

-Original Message-
From: Gary Gregory  
Sent: Friday, November 19, 2021 8:55 AM
To: Commons Users List 
Subject: Re: [io] FileUtils.listFiles activates forces OneDrive files to 
download?

Your example is too vague, what is the value of "start"?

Gary


On Fri, Nov 19, 2021, 09:52  wrote:

> Hi,
>
>
>
> I have a large drive of cloud files in OneDrive that aren't stored locally.
>
> The following code forces any files traversed to download locally 
> which is not preferable to say the least.
>
>
>
> https://pastebin.com/hmA0jTLy
>
>
>
> Is there a particular reason this happens with FileUtils.listFiles and 
> not with java.io.File.listFiles?
>
>
>
> Thanks
>
>


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [io] FileUtils.listFiles activates forces OneDrive files to download?

2021-11-19 Thread Gary Gregory
Your example is too vague, what is the value of "start"?

Gary


On Fri, Nov 19, 2021, 09:52  wrote:

> Hi,
>
>
>
> I have a large drive of cloud files in OneDrive that aren't stored locally.
>
> The following code forces any files traversed to download locally which is
> not preferable to say the least.
>
>
>
> https://pastebin.com/hmA0jTLy
>
>
>
> Is there a particular reason this happens with FileUtils.listFiles and not
> with java.io.File.listFiles?
>
>
>
> Thanks
>
>