[jira] [Commented] (IO-783) Fetching file extension using FilenameUtils.getExtension method throws error in windows machine

2023-05-08 Thread Samraj (Jira)


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

Samraj commented on IO-783:
---

Verified the code and that was wrong implementation. I have Unix path or EMail 
path. In that path colon is eligible. When i try to parse that value in windows 
machine, I am getting error. If I run that code in linux, it is working fine. 
String parsing should not contain OS check. 

> Fetching file extension using FilenameUtils.getExtension method throws error 
> in windows machine
> ---
>
> Key: IO-783
> URL: https://issues.apache.org/jira/browse/IO-783
> Project: Commons IO
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.7, 2.8.0, 2.9.0, 2.10.0, 2.11.0
> Environment: Run the below line of code in windows environment.
> String fileName = FilenameUtils.getExtension("Top of Information 
> Store\\Archive\\Informational-severity alert: eDiscovery search started or 
> exported.msg");
>         System.out.println(fileName);
>  
> We are getting the error,
> Exception in thread "main" java.lang.IllegalArgumentException: NTFS ADS 
> separator (':') in file name is forbidden.
>     at 
> org.apache.commons.io.FilenameUtils.indexOfExtension(FilenameUtils.java:737)
>     at 
> org.apache.commons.io.FilenameUtils.getExtension(FilenameUtils.java:1057)
>Reporter: Samraj
>Priority: Blocker
>
> Hi Team,
> I am using FilenameUtils.getExtension method to get the file extension from 
> the file path ( Available as string). Due to one of the bug fix happen after 
> 2.7 breaks the code. 
> Run the below line of code in windows environment.
> String fileName = FilenameUtils.getExtension("Top of Information 
> Store\\Archive
> Informational-severity alert: eDiscovery search started or exported.msg");
>         System.out.println(fileName);
>  
> We are getting the error,
> Exception in thread "main" java.lang.IllegalArgumentException: NTFS ADS 
> separator (':') in file name is forbidden.
>     at 
> org.apache.commons.io.FilenameUtils.indexOfExtension(FilenameUtils.java:737)
>     at 
> org.apache.commons.io.FilenameUtils.getExtension(FilenameUtils.java:1057)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (IO-783) Fetching file extension using FilenameUtils.getExtension method throws error in windows machine

2022-11-01 Thread Samraj (Jira)


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

Samraj updated IO-783:
--
Description: 
Hi Team,

I am using FilenameUtils.getExtension method to get the file extension from the 
file path ( Available as string). Due to one of the bug fix happen after 2.7 
breaks the code. 

Run the below line of code in windows environment.

String fileName = FilenameUtils.getExtension("Top of Information Store\\Archive
Informational-severity alert: eDiscovery search started or exported.msg");
        System.out.println(fileName);

 

We are getting the error,

Exception in thread "main" java.lang.IllegalArgumentException: NTFS ADS 
separator (':') in file name is forbidden.
    at 
org.apache.commons.io.FilenameUtils.indexOfExtension(FilenameUtils.java:737)
    at org.apache.commons.io.FilenameUtils.getExtension(FilenameUtils.java:1057)

  was:
Hi Team,

I am using FilenameUtils.getExtension method to get the file extension from the 
file path ( Available as string). Due to one of the bug fix happen after 2.7 
breaks the code. 


> Fetching file extension using FilenameUtils.getExtension method throws error 
> in windows machine
> ---
>
> Key: IO-783
> URL: https://issues.apache.org/jira/browse/IO-783
> Project: Commons IO
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.7, 2.8.0, 2.9.0, 2.10.0, 2.11.0
> Environment: Run the below line of code in windows environment.
> String fileName = FilenameUtils.getExtension("Top of Information 
> Store\\Archive\\Informational-severity alert: eDiscovery search started or 
> exported.msg");
>         System.out.println(fileName);
>  
> We are getting the error,
> Exception in thread "main" java.lang.IllegalArgumentException: NTFS ADS 
> separator (':') in file name is forbidden.
>     at 
> org.apache.commons.io.FilenameUtils.indexOfExtension(FilenameUtils.java:737)
>     at 
> org.apache.commons.io.FilenameUtils.getExtension(FilenameUtils.java:1057)
>Reporter: Samraj
>Priority: Blocker
>
> Hi Team,
> I am using FilenameUtils.getExtension method to get the file extension from 
> the file path ( Available as string). Due to one of the bug fix happen after 
> 2.7 breaks the code. 
> Run the below line of code in windows environment.
> String fileName = FilenameUtils.getExtension("Top of Information 
> Store\\Archive
> Informational-severity alert: eDiscovery search started or exported.msg");
>         System.out.println(fileName);
>  
> We are getting the error,
> Exception in thread "main" java.lang.IllegalArgumentException: NTFS ADS 
> separator (':') in file name is forbidden.
>     at 
> org.apache.commons.io.FilenameUtils.indexOfExtension(FilenameUtils.java:737)
>     at 
> org.apache.commons.io.FilenameUtils.getExtension(FilenameUtils.java:1057)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (IO-783) Fetching file extension using FilenameUtils.getExtension method throws error in windows machine

2022-11-01 Thread Samraj (Jira)
Samraj created IO-783:
-

 Summary: Fetching file extension using FilenameUtils.getExtension 
method throws error in windows machine
 Key: IO-783
 URL: https://issues.apache.org/jira/browse/IO-783
 Project: Commons IO
  Issue Type: Bug
  Components: Utilities
Affects Versions: 2.11.0, 2.10.0, 2.9.0, 2.8.0, 2.7
 Environment: Run the below line of code in windows environment.

String fileName = FilenameUtils.getExtension("Top of Information 
Store\\Archive\\Informational-severity alert: eDiscovery search started or 
exported.msg");
        System.out.println(fileName);

 

We are getting the error,

Exception in thread "main" java.lang.IllegalArgumentException: NTFS ADS 
separator (':') in file name is forbidden.
    at 
org.apache.commons.io.FilenameUtils.indexOfExtension(FilenameUtils.java:737)
    at org.apache.commons.io.FilenameUtils.getExtension(FilenameUtils.java:1057)
Reporter: Samraj


Hi Team,

I am using FilenameUtils.getExtension method to get the file extension from the 
file path ( Available as string). Due to one of the bug fix happen after 2.7 
breaks the code. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)