[ 
https://issues.apache.org/jira/browse/FLINK-11867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tom Goong updated FLINK-11867:
------------------------------
    Description: 
In class StreamExecutionEnvironment

 
{code:java}
// code placeholder
public DataStreamSource<String> readTextFile(String filePath, String 
charsetName) {
Preconditions.checkNotNull(filePath, "The file path must not be null.");
Preconditions.checkNotNull(filePath.isEmpty(), "The file path must not be 
empty.");

TextInputFormat format = new TextInputFormat(new Path(filePath));
format.setFilesFilter(FilePathFilter.createDefaultFilter());
TypeInformation<String> typeInfo = BasicTypeInfo.STRING_TYPE_INFO;
format.setCharsetName(charsetName);

return readFile(format, filePath, FileProcessingMode.PROCESS_ONCE, -1, 
typeInfo);
}
{code}
 

the `Preconditions.checkNotNull(filePath.isEmpty(), "The file path must not be 
empty.");` this will not work

> mistaking in checking filePath's value
> --------------------------------------
>
>                 Key: FLINK-11867
>                 URL: https://issues.apache.org/jira/browse/FLINK-11867
>             Project: Flink
>          Issue Type: Bug
>          Components: Build System
>            Reporter: Tom Goong
>            Assignee: Tom Goong
>            Priority: Major
>
> In class StreamExecutionEnvironment
>  
> {code:java}
> // code placeholder
> public DataStreamSource<String> readTextFile(String filePath, String 
> charsetName) {
> Preconditions.checkNotNull(filePath, "The file path must not be null.");
> Preconditions.checkNotNull(filePath.isEmpty(), "The file path must not be 
> empty.");
> TextInputFormat format = new TextInputFormat(new Path(filePath));
> format.setFilesFilter(FilePathFilter.createDefaultFilter());
> TypeInformation<String> typeInfo = BasicTypeInfo.STRING_TYPE_INFO;
> format.setCharsetName(charsetName);
> return readFile(format, filePath, FileProcessingMode.PROCESS_ONCE, -1, 
> typeInfo);
> }
> {code}
>  
> the `Preconditions.checkNotNull(filePath.isEmpty(), "The file path must not 
> be empty.");` this will not work



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to