cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload Date in Java

omkar
Champ in-the-making
Champ in-the-making
Hi,

   I want help to write a java code to retrieve the file uploaded date. Is there any provision to get this date in Java. Are there any Alfresco API available.
   The version used is Version: Community - v3.2.0 (2039). The code snippet used to retrieve is as below:


public GeneralVO getFile(Reference space)
{
String id = null;
GeneralVO generalVO = null;
try
{
createSession ();
try
{
Node[] nodes = getRepositoryService ().get (new Predicate (new Reference[]
{ space }, STORE, null));
Reference nodeRef = nodes[0].getReference ();
QueryResult rootChildren = getRepositoryService ().queryChildren (nodeRef);
ResultSet rootChildrenResults = rootChildren.getResultSet ();
ResultSetRow[] row = rootChildrenResults.getRows ();
if (row != null)
{
for (ResultSetRow rows : row)
{
generalVO = new GeneralVO ();
id = rows.getNode ().getId ();
// generalVO.setId(id);

NamedValue[] values = rows.getColumns ();
for (NamedValue col : values)
{
String strValue = col.getValue ();
if (col.getName ().endsWith (Constants.PROP_NAME) == true)
{

int fileTpe = strValue.indexOf (".");
if (fileTpe != -1)
{
generalVO.setId (id);
generalVO.setName (strValue);

}
}
}
}
}
}
catch(AxisFault af){
System.out.println(af.getFaultCode());
} catch (Exception ex)
{
ex.printStackTrace ();
}
} catch (Exception e)
{
System.err.println ("Can not initiate session with Alfresco server.");
e.printStackTrace ();
}
return generalVO;
}

   Thank you in advance.

Regards,
   Omkar.
1 REPLY 1

smithwilliams
Champ in-the-making
Champ in-the-making
Lock up your FaceBook, Whatsapp, Messenger and other important apps which may leak your privacy with LEO Privacy Guard 3.0 on android or iOS  mobile phones and tablets.