result.put(URIConverter.ATTRIBUTE_EXECUTABLE, resourceAttributes.isExecutable());
result.put(URIConverter.ATTRIBUTE_EXECUTABLE, resourceAttributes.isExecutable());
if (attrs != null) { previousReadOnlyValue = attrs.isReadOnly(); previousExecutableValue = attrs.isExecutable(); previousArchiveValue = attrs.isArchive(); if (editableBox != null) { executableBox.setSelection(attrs.isExecutable());
public void setResourceAttributes(IResource resource, ResourceAttributes attributes) throws CoreException { IFileStore store = getStore(resource); //when the executable bit is changed on a folder a refresh is required boolean refresh = false; if (resource instanceof IContainer && ((store.getFileSystem().attributes() & EFS.ATTRIBUTE_EXECUTABLE) != 0)) refresh = store.fetchInfo().getAttribute(EFS.ATTRIBUTE_EXECUTABLE) != attributes.isExecutable(); store.putInfo(FileUtil.attributesToFileInfo(attributes), EFS.SET_ATTRIBUTES, null); //must refresh in the background because we are not inside an operation if (refresh) workspace.getRefreshManager().refresh(resource); }
public void setResourceAttributes(IResource resource, ResourceAttributes attributes) throws CoreException { IFileStore store = getStore(resource); //when the executable bit is changed on a folder a refresh is required boolean refresh = false; if (resource instanceof IContainer && ((store.getFileSystem().attributes() & EFS.ATTRIBUTE_EXECUTABLE) != 0)) refresh = store.fetchInfo().getAttribute(EFS.ATTRIBUTE_EXECUTABLE) != attributes.isExecutable(); store.putInfo(FileUtil.attributesToFileInfo(attributes), EFS.SET_ATTRIBUTES, null); //must refresh in the background because we are not inside an operation if (refresh) workspace.getRefreshManager().refresh(resource); }
public void setResourceAttributes(IResource resource, ResourceAttributes attributes) throws CoreException { IFileStore store = getStore(resource); //when the executable bit is changed on a folder a refresh is required boolean refresh = false; if (resource instanceof IContainer && ((store.getFileSystem().attributes() & EFS.ATTRIBUTE_EXECUTABLE) != 0)) refresh = store.fetchInfo().getAttribute(EFS.ATTRIBUTE_EXECUTABLE) != attributes.isExecutable(); store.putInfo(FileUtil.attributesToFileInfo(attributes), EFS.SET_ATTRIBUTES, null); //must refresh in the background because we are not inside an operation if (refresh) workspace.getRefreshManager().refresh(resource); }
@Override public void write(IContainer container, String destinationPath) throws IOException { if (!resolveLinks && container.isLinked(IResource.DEPTH_INFINITE)) { return; } TarEntry newEntry = new TarEntry(destinationPath); if(container.getLocalTimeStamp() != IResource.NULL_STAMP) { newEntry.setTime(container.getLocalTimeStamp() / 1000); } ResourceAttributes attributes = container.getResourceAttributes(); if (attributes != null && attributes.isExecutable()) { newEntry.setMode(newEntry.getMode() | 0111); } if (attributes != null && attributes.isReadOnly()) { newEntry.setMode(newEntry.getMode() & ~0222); } newEntry.setFileType(TarEntry.DIRECTORY); outputStream.putNextEntry(newEntry); }
if (attrs != null) { previousReadOnlyValue = attrs.isReadOnly(); previousExecutableValue = attrs.isExecutable(); previousArchiveValue = attrs.isArchive(); } else {
/** * Write the passed resource to the current archive. * * @param resource org.eclipse.core.resources.IFile * @param destinationPath java.lang.String * @exception java.io.IOException * @exception org.eclipse.core.runtime.CoreException */ @Override public void write(IFile resource, String destinationPath) throws IOException, CoreException { if (!resolveLinks && resource.isLinked(IResource.DEPTH_INFINITE)) { return; } 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); } write(newEntry, resource); } }
/** * Converts a ResourceAttributes object into an IFileInfo object. * @param attributes The resource attributes * @return The file info */ public static IFileInfo attributesToFileInfo(ResourceAttributes attributes) { IFileInfo fileInfo = EFS.createFileInfo(); fileInfo.setAttribute(EFS.ATTRIBUTE_READ_ONLY, attributes.isReadOnly()); fileInfo.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, attributes.isExecutable()); fileInfo.setAttribute(EFS.ATTRIBUTE_ARCHIVE, attributes.isArchive()); fileInfo.setAttribute(EFS.ATTRIBUTE_HIDDEN, attributes.isHidden()); fileInfo.setAttribute(EFS.ATTRIBUTE_SYMLINK, attributes.isSymbolicLink()); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_READ, attributes.isSet(EFS.ATTRIBUTE_GROUP_READ)); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_WRITE, attributes.isSet(EFS.ATTRIBUTE_GROUP_WRITE)); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, attributes.isSet(EFS.ATTRIBUTE_GROUP_EXECUTE)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_READ, attributes.isSet(EFS.ATTRIBUTE_OTHER_READ)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_WRITE, attributes.isSet(EFS.ATTRIBUTE_OTHER_WRITE)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, attributes.isSet(EFS.ATTRIBUTE_OTHER_EXECUTE)); return fileInfo; }
/** * Converts a ResourceAttributes object into an IFileInfo object. * @param attributes The resource attributes * @return The file info */ public static IFileInfo attributesToFileInfo(ResourceAttributes attributes) { IFileInfo fileInfo = EFS.createFileInfo(); fileInfo.setAttribute(EFS.ATTRIBUTE_READ_ONLY, attributes.isReadOnly()); fileInfo.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, attributes.isExecutable()); fileInfo.setAttribute(EFS.ATTRIBUTE_ARCHIVE, attributes.isArchive()); fileInfo.setAttribute(EFS.ATTRIBUTE_HIDDEN, attributes.isHidden()); fileInfo.setAttribute(EFS.ATTRIBUTE_SYMLINK, attributes.isSymbolicLink()); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_READ, attributes.isSet(EFS.ATTRIBUTE_GROUP_READ)); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_WRITE, attributes.isSet(EFS.ATTRIBUTE_GROUP_WRITE)); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, attributes.isSet(EFS.ATTRIBUTE_GROUP_EXECUTE)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_READ, attributes.isSet(EFS.ATTRIBUTE_OTHER_READ)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_WRITE, attributes.isSet(EFS.ATTRIBUTE_OTHER_WRITE)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, attributes.isSet(EFS.ATTRIBUTE_OTHER_EXECUTE)); return fileInfo; }
/** * Converts a ResourceAttributes object into an IFileInfo object. * @param attributes The resource attributes * @return The file info */ public static IFileInfo attributesToFileInfo(ResourceAttributes attributes) { IFileInfo fileInfo = EFS.createFileInfo(); fileInfo.setAttribute(EFS.ATTRIBUTE_READ_ONLY, attributes.isReadOnly()); fileInfo.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, attributes.isExecutable()); fileInfo.setAttribute(EFS.ATTRIBUTE_ARCHIVE, attributes.isArchive()); fileInfo.setAttribute(EFS.ATTRIBUTE_HIDDEN, attributes.isHidden()); fileInfo.setAttribute(EFS.ATTRIBUTE_SYMLINK, attributes.isSymbolicLink()); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_READ, attributes.isSet(EFS.ATTRIBUTE_GROUP_READ)); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_WRITE, attributes.isSet(EFS.ATTRIBUTE_GROUP_WRITE)); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, attributes.isSet(EFS.ATTRIBUTE_GROUP_EXECUTE)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_READ, attributes.isSet(EFS.ATTRIBUTE_OTHER_READ)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_WRITE, attributes.isSet(EFS.ATTRIBUTE_OTHER_WRITE)); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, attributes.isSet(EFS.ATTRIBUTE_OTHER_EXECUTE)); return fileInfo; }