当前位置: 首页>>代码示例>>Java>>正文


Java EFS.ATTRIBUTE_READ_ONLY属性代码示例

本文整理汇总了Java中org.eclipse.core.filesystem.EFS.ATTRIBUTE_READ_ONLY属性的典型用法代码示例。如果您正苦于以下问题:Java EFS.ATTRIBUTE_READ_ONLY属性的具体用法?Java EFS.ATTRIBUTE_READ_ONLY怎么用?Java EFS.ATTRIBUTE_READ_ONLY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.core.filesystem.EFS的用法示例。


在下文中一共展示了EFS.ATTRIBUTE_READ_ONLY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setAttribute

public void setAttribute(int attribute, boolean value) {
  if (attribute == EFS.ATTRIBUTE_READ_ONLY && isAttributeSuported(EFS.ATTRIBUTE_OWNER_WRITE)) {
    if (value) {
      clear(EFS.ATTRIBUTE_OWNER_WRITE | EFS.ATTRIBUTE_OTHER_WRITE | EFS.ATTRIBUTE_GROUP_WRITE);
      set(EFS.ATTRIBUTE_IMMUTABLE);
    } else {
      set(EFS.ATTRIBUTE_OWNER_WRITE | EFS.ATTRIBUTE_OWNER_READ);
      clear(EFS.ATTRIBUTE_IMMUTABLE);
    }
  } else if (attribute == EFS.ATTRIBUTE_EXECUTABLE
      && isAttributeSuported(EFS.ATTRIBUTE_OWNER_EXECUTE)) {
    if (value) set(EFS.ATTRIBUTE_OWNER_EXECUTE);
    else
      clear(
          EFS.ATTRIBUTE_OWNER_EXECUTE
              | EFS.ATTRIBUTE_GROUP_EXECUTE
              | EFS.ATTRIBUTE_OTHER_EXECUTE);
  } else {
    if (value) set(attribute);
    else clear(attribute);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:FileInfo.java

示例2: getAttribute

public boolean getAttribute(int attribute) {
  if (attribute == EFS.ATTRIBUTE_READ_ONLY && isAttributeSuported(EFS.ATTRIBUTE_OWNER_WRITE))
    return (!isSet(EFS.ATTRIBUTE_OWNER_WRITE)) || isSet(EFS.ATTRIBUTE_IMMUTABLE);
  else if (attribute == EFS.ATTRIBUTE_EXECUTABLE
      && isAttributeSuported(EFS.ATTRIBUTE_OWNER_EXECUTE))
    return isSet(EFS.ATTRIBUTE_OWNER_EXECUTE);
  else return isSet(attribute);
}
 
开发者ID:eclipse,项目名称:che,代码行数:8,代码来源:FileInfo.java

示例3: attributes

@Override
public int attributes() {
	if (attributes != -1)
		return attributes;
	attributes = 0;
	attributes |= EFS.ATTRIBUTE_READ_ONLY;
	attributes |= EFS.ATTRIBUTE_EXECUTABLE;
	attributes |= EFS.ATTRIBUTE_SYMLINK | EFS.ATTRIBUTE_LINK_TARGET;
	return attributes;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:10,代码来源:VirtualFileSystem.java

示例4: attributes

private static int attributes(File aFile) {
  if (!aFile.exists() || aFile.canWrite()) return EFS.NONE;
  return EFS.ATTRIBUTE_READ_ONLY;
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:LocalFile.java

示例5: checkReadOnlyParent

/**
 * This method is called after a failure to modify a file or directory. Check to see if the parent
 * is read-only and if so then throw an exception with a more specific message and error code.
 *
 * @param target The file that we failed to modify
 * @param exception The low level exception that occurred, or <code>null</code>
 * @throws CoreException A more specific exception if the parent is read-only
 */
private void checkReadOnlyParent(File target, Throwable exception) throws CoreException {
  File parent = target.getParentFile();
  if (parent != null && (attributes(parent) & EFS.ATTRIBUTE_READ_ONLY) != 0) {
    String message = NLS.bind(Messages.readOnlyParent, target.getAbsolutePath());
    Policy.error(EFS.ERROR_PARENT_READ_ONLY, message, exception);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:15,代码来源:LocalFile.java

示例6: isReadOnly

/**
 * Returns whether this ResourceAttributes object is marked read only.
 *
 * <p>This attribute is used only on file systems supporting {@link EFS#ATTRIBUTE_READ_ONLY}.
 *
 * @return <code>true</code> if this resource is marked as read only, <code>false</code> otherwise
 * @see #setReadOnly(boolean)
 * @see IFileSystem#attributes()
 * @see EFS#ATTRIBUTE_READ_ONLY
 */
public boolean isReadOnly() {
  return (attributes & EFS.ATTRIBUTE_READ_ONLY) != 0;
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:ResourceAttributes.java


注:本文中的org.eclipse.core.filesystem.EFS.ATTRIBUTE_READ_ONLY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。