This commit is contained in:
Roman Shevchenko
2012-09-07 22:22:53 +04:00
parent 28763c431a
commit 54db6cbc57
4 changed files with 19 additions and 19 deletions
@@ -18,7 +18,7 @@ package org.intellij.lang.annotations;
import java.lang.annotation.*;
/**
* <p>This annotation indended to help IDEA to detect and auto-complete int and String constants used as an enumeration.
* <p>This annotation intended to help IDEA to detect and auto-complete int and String constants used as an enumeration.
* For example, in the {@link java.awt.Label#Label(String, int)} constructor the <tt><b>alignment</b></tt> parameter can be one of the following
* int constants: {@link java.awt.Label#LEFT}, {@link java.awt.Label#CENTER} or {@link java.awt.Label#RIGHT}
*
@@ -134,11 +134,11 @@ public abstract class NewVirtualFile extends VirtualFile implements VirtualFileW
@NotNull
public abstract Collection<VirtualFile> getCachedChildren();
@NotNull
/** iterated children will NOT contain NullVirtualFile.INSTANCE */
@NotNull
public abstract Iterable<VirtualFile> iterInDbChildren();
public abstract void setFlag(int flag_mask, boolean value);
public abstract void setFlag(int flagMask, boolean value);
public abstract boolean getFlag(int flag_mask);
public abstract boolean getFlag(int flagMask);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
package com.intellij.util.io;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
@@ -26,18 +25,20 @@ public class ReadOnlyAttributeUtil {
/**
* Sets specified read-only status for the spcified <code>file</code>.
* This method can be performed only for files which are in local file system.
* @param file file which read-only attribute to be changed.
*
* @param file file which read-only attribute to be changed.
* @param readOnlyStatus new read-only status.
* @throws java.lang.IllegalArgumentException if passed <code>file</code> doesn't
* belong to the local file system.
* @throws IOException if some <code>IOExecption</code> occurred.
* @throws java.lang.IllegalArgumentException
* if passed <code>file</code> doesn't
* belong to the local file system.
* @throws IOException if some <code>IOException</code> occurred.
*/
public static void setReadOnlyAttribute(VirtualFile file, boolean readOnlyStatus) throws IOException {
if (file.getFileSystem().isReadOnly()) {
throw new IllegalArgumentException("Wrong file system: "+file.getFileSystem());
throw new IllegalArgumentException("Wrong file system: " + file.getFileSystem());
}
if(file.isWritable()==!readOnlyStatus){
if (file.isWritable() == !readOnlyStatus) {
return;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* @author max
*/
package com.intellij.openapi.vfs.newvfs.impl;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.NonNls;
/**
* @author max
*/
public class FakeVirtualFile extends StubVirtualFile {
private final VirtualFile myParent;
private final String myName;
@@ -42,8 +42,7 @@ public class FakeVirtualFile extends StubVirtualFile {
@Override
public String getPath() {
final String basePath = myParent.getPath();
if (basePath.endsWith("/")) return basePath + myName;
return basePath + '/' + myName;
return StringUtil.endsWithChar(basePath, '/') ? basePath + myName : basePath + '/' + myName;
}
@Override