* @exception org.eclipse.core.runtime.CoreException
*/
public void write(IFile resource, String destinationPath)
throws IOException, CoreException {
TarEntry newEntry = new TarEntry(destinationPath);
if (resource.getLocalTimeStamp() != IResource.NULL_STAMP) {
newEntry.setTime(resource.getLocalTimeStamp() / 1000);
}
ResourceAttributes attributes = resource.getResourceAttributes();
if (attributes != null && attributes.isExecutable()) {
newEntry.setMode(newEntry.getMode() | 0111);
}
if (attributes != null && attributes.isReadOnly()) {
newEntry.setMode(newEntry.getMode() & ~0222);
}
final URI location = resource.getLocationURI();
if (location == null) {
throw new FileNotFoundException(resource.getFullPath().toOSString());
}
newEntry.setSize(EFS.getStore(location).fetchInfo().getLength());
write(newEntry, resource.getContents(false));
}