how can I get the extension of a file
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2007 07:39 AM
Hi,
I have this piece of code
Please tell me if there is any way to get the extension of a file returned as a query result.
George :roll:
I have this piece of code
QueryResult result = getRepositoryService().query(store, queryStr, true); if (result != null) { ResultSetRow[] rows = result.getResultSet().getRows(); // ….each row from the result represents a document here I want to extract for each document it's extension…. // }
Please tell me if there is any way to get the extension of a file returned as a query result.
George :roll:
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2007 07:30 AM
Try to get for each row its columns name and values. You can get every property, including the file's name (with its extension), mime type and so on….
for (ResultSetRow row : resultset.getRows()) { NamedValue[] columns = row.getColumns(); System.out.println("**********row : "); for (int y = 0; y < columns.length; y++) { System.out.println(row.getColumns(y).getName() + " = " + row.getColumns(y).getValue()); } }
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2007 08:47 AM
Thanks,
I already found it. :idea:
I already found it. :idea:
