File Metadata - Java API
One answer
IFileContentManager contentManager = FileSystemCore.getContentManager(repo);
storecontent lets you set encoding and line feed
IFileContent newcontent = contentManager.storeContent(content.getCharacterEncoding(),content.getLineDelimiter(),
new VersionedContentManagerByteArrayInputStreamPovider(FileUtils.readFileToByteArray(tmpfile)),null, MONITOR);
IFileItem should let you set the date
// Get Working copy
file = (IFileItem) file.getWorkingCopy();
file.setContent(storedContent);
file.setFileTimestamp(new Date());
storecontent lets you set encoding and line feed
IFileContent newcontent = contentManager.storeContent(content.getCharacterEncoding(),content.getLineDelimiter(),
new VersionedContentManagerByteArrayInputStreamPovider(FileUtils.readFileToByteArray(tmpfile)),null, MONITOR);
IFileItem should let you set the date
// Get Working copy
file = (IFileItem) file.getWorkingCopy();
file.setContent(storedContent);
file.setFileTimestamp(new Date());
Comments
Surya Tripathi
May 08 '15, 8:25 p.m.I think you can use com.ibm.team.filesystem.common.IFileItem.setFileTimestamp() to set file time stamp and