public void testSetReadOnly() { IFileStore file = baseStore.getChild("file"); ensureExists(file, false); IFileInfo info = EFS.createFileInfo(); info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, true); try { file.putInfo(info, EFS.SET_ATTRIBUTES, getMonitor()); } catch (CoreException e) { fail("1.99", e); } info = file.fetchInfo(); assertEquals("1.0", true, info.getAttribute(EFS.ATTRIBUTE_READ_ONLY)); assertEquals("1.1", file.getName(), info.getName()); }
public void testSetFileLastModified() { IFileStore file = baseStore.getChild("file"); ensureExists(file, false); IFileInfo info = file.fetchInfo(); long oldLastModified = info.getLastModified(); long newLastModified = oldLastModified + 100; info = EFS.createFileInfo(); info.setLastModified(newLastModified); try { file.putInfo(info, EFS.SET_LAST_MODIFIED, getMonitor()); } catch (CoreException e) { fail("1.99", e); } info = file.fetchInfo(); assertEquals("1.0", newLastModified, info.getLastModified()); assertEquals("1.1", file.getName(), info.getName()); }