You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Pei He (JIRA)" <ji...@apache.org> on 2016/12/13 20:01:58 UTC

[jira] [Comment Edited] (BEAM-1045) Windows OS compatibilities

    [ https://issues.apache.org/jira/browse/BEAM-1045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15746111#comment-15746111 ] 

Pei He edited comment on BEAM-1045 at 12/13/16 8:01 PM:
--------------------------------------------------------

Summary of Windows OS support in Java File/Path libraries.

1. File works for file scheme, asterisk in the path:
{code}
new File("file:\\\\\\C:\\")
new File("file:\\C:\\")
new File("file:C:\\")
new File("file:C:\\a*")
new File("file:\\C:\\*")
new File("file:\\\\abc\\C:\\D:")
new File("C:\\a*")
{code}
2. Path throws for file schema, asterisk in the path or in resolve():
{code}
new File("file:C:\\a*").toPath() will throw.
new File("file:C:\\").toPath().resolve("a*") will throw.
{code}


was (Author: peihe0@gmail.com):
Summary of Windows OS support in Java File/Path libraries.

1. File works for file scheme, asterisk in the path:
new File("file:\\\\\\C:\\")
new File("file:\\C:\\")
new File("file:C:\\")
new File("file:C:\\a*")
new File("file:\\C:\\*")
new File("file:\\\\abc\\C:\\D:")
new File("C:\\a*")

2. Path throws for file schema, asterisk in the path or in resolve():
new File("file:C:\\a*").toPath() will throw.
new File("file:C:\\").toPath().resolve("a*") will throw.

> Windows OS compatibilities
> --------------------------
>
>                 Key: BEAM-1045
>                 URL: https://issues.apache.org/jira/browse/BEAM-1045
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-java-core, sdk-java-gcp
>            Reporter: Pei He
>
> One known issue is "*" is not allowed in Windows OS.
> For example, Paths.get("tempDir/*") might throw when code runs in Windows OS.
> http://stackoverflow.com/questions/27522581/asterisks-in-java-path
> This affecting IOChannelFactory.match(String glob).
> However, since match only requires support globs in the final component of a path. (local) FileIOChannelFactory could do things similar as GcsIOChannelFactory:
> First, list all files under the directory path (this won't contain glob, such as *).
> Then, check each returned files whether it matches glob.
> In this way, glob (*) stays within Apache Beam's code.
> From match()'s javadoc:
> """
> Glob handling is dependent on the implementation.  Implementations should
>    * all support globs in the final component of a path (eg /foo/bar/*.txt),
>    * however they are not required to support globs in the directory paths.
> """



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)