SilverHoodCorp / gdata-java-client

Automatically exported from code.google.com/p/gdata-java-client
Apache License 2.0
0 stars 0 forks source link

DocumentListEntry.MediaType.fromFileName uses first . in file name instead of last . #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. File f = new File("test.file.xls");
2. DocumentListEntry.MediaType.fromFileName(f.getName()).getMimeType()

What is the expected output? What do you see instead?
java.lang.IllegalArgumentException: No enum const class
com.google.gdata.data.docs.DocumentListEntry$MediaType.FILE.XLS
at java.lang.Enum.valueOf(Enum.java:196)
at
com.google.gdata.data.docs.DocumentListEntry$MediaType.valueOf(DocumentListEntry
.java:61)
at
com.google.gdata.data.docs.DocumentListEntry$MediaType.fromFileName(DocumentList
Entry.java:97)

What version of the product are you using? On what operating system?
GDocs-Java/2.0.1 GData-Java/1.35.1(gzip)

Please provide any additional information below.
File com.google.gdata.data.docs.DocumentListEntry.java line 95:
int index = fileName.indexOf('.');
replace with:
int index = fileName.lastIndexOf('.');

Original issue reported on code.google.com by blpha...@gmail.com on 12 Aug 2009 at 11:30

GoogleCodeExporter commented 9 years ago
Will be fixed in the next release.

Original comment by vbarat...@gmail.com on 24 Aug 2009 at 5:59

GoogleCodeExporter commented 9 years ago
Fixed in 1.36.0

Original comment by vbarat...@gmail.com on 26 Aug 2009 at 2:16