Java Code Examples for org.eclipse.core.filesystem.IFileStore#putInfo()

The following examples show how to use org.eclipse.core.filesystem.IFileStore#putInfo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FileHandlerV1.java    From orion.server with Eclipse Public License 1.0 5 votes vote down vote up
private void handlePutMetadata(BufferedReader reader, String boundary, IFileStore file) throws IOException, CoreException, JSONException {
	StringBuffer buf = new StringBuffer();
	String line;
	while ((line = reader.readLine()) != null && !line.equals(boundary))
		buf.append(line);
	// merge with existing metadata
	FileInfo info = (FileInfo) file.fetchInfo(EFS.NONE, null);
	ServletFileStoreHandler.copyJSONToFileInfo(new JSONObject(buf.toString()), info);
	file.putInfo(info, EFS.SET_ATTRIBUTES, null);
}
 
Example 2
Source File: DirectoryHandlerV1.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
private boolean handlePut(HttpServletRequest request, HttpServletResponse response, IFileStore dir) throws JSONException, IOException, CoreException {
	IFileInfo info = ServletFileStoreHandler.fromJSON(request);
	dir.putInfo(info, EFS.NONE, null);
	return true;
}
 
Example 3
Source File: EFSUtils.java    From APICloud-Studio with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Sets the modification time of the client file
 * 
 * @param serverFile
 * @param clientFile
 * @throws CoreException
 */
public static void setModificationTime(long modifiedTime, IFileStore destFile) throws CoreException
{
	IFileInfo fi = new FileInfo();
	fi.setLastModified(modifiedTime);
	destFile.putInfo(fi, EFS.SET_LAST_MODIFIED, null);
}