cancel
Showing results for 
Search instead for 
Did you mean: 

how can I get the extension of a file

google
Champ in-the-making
Champ in-the-making
Hi,

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:
2 REPLIES 2

alexcocia
Champ in-the-making
Champ in-the-making
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());
               }
            }

google
Champ in-the-making
Champ in-the-making
Thanks,
I already found it.  :idea: