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


Java IOUtil.readString方法代码示例

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


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

示例1: load

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public void load(DataInputStream in, JpsModel model, final BuildRootIndex buildRootIndex) throws IOException {
  final TargetTypeRegistry registry = TargetTypeRegistry.getInstance();
  int typeCount = in.readInt();
  while (typeCount-- > 0) {
    final String typeId = IOUtil.readString(in);
    int targetCount = in.readInt();
    BuildTargetType<?> type = registry.getTargetType(typeId);
    BuildTargetLoader<?> loader = type != null ? type.createLoader(model) : null;
    while (targetCount-- > 0) {
      final String id = IOUtil.readString(in);
      boolean loaded = false;
      if (loader != null) {
        BuildTarget<?> target = loader.createTarget(id);
        if (target != null) {
          getDelta(target).load(in, target, buildRootIndex);
          myInitialScanPerformed.add(target);
          loaded = true;
        }
      }
      if (!loaded) {
        LOG.info("Skipping unknown target (typeId=" + typeId + ", type=" + type + ", id=" + id + ")");
        FilesDelta.skip(in);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:BuildFSState.java

示例2: getFrameworkIdOfBuildFile

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
@Nullable
public static String getFrameworkIdOfBuildFile(VirtualFile file) {
  if (file instanceof NewVirtualFile) {
    final DataInputStream is = FRAMEWORK_FILE_ATTRIBUTE.readAttribute(file);
    if (is != null) {
      try {
        try {
          if (is.available() == 0) {
            return null;
          }
          return IOUtil.readString(is);
        }
        finally {
          is.close();
        }
      }
      catch (IOException e) {
        LOG.error(file.getPath(), e);
      }
    }
    return "";
  }
  return file.getUserData(FRAMEWORK_FILE_MARKER);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ForcedBuildFileAttribute.java

示例3: load

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public void load(DataInput in, @NotNull BuildTarget<?> target, BuildRootIndex buildRootIndex) throws IOException {
  lockData();
  try {
    myDeletedPaths.clear();
    int deletedCount = in.readInt();
    while (deletedCount-- > 0) {
      myDeletedPaths.add(IOUtil.readString(in));
    }
    myFilesToRecompile.clear();
    int recompileCount = in.readInt();
    while (recompileCount-- > 0) {
      String rootId = IOUtil.readString(in);
      BuildRootDescriptor descriptor = target.findRootDescriptor(rootId, buildRootIndex);
      Set<File> files;
      if (descriptor != null) {
        files = myFilesToRecompile.get(descriptor);
        if (files == null) {
          files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
          myFilesToRecompile.put(descriptor, files);
        }
      }
      else {
        LOG.debug("Cannot find root by " + rootId + ", delta will be skipped");
        files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
      }
      int filesCount = in.readInt();
      while (filesCount-- > 0) {
        final File file = new File(IOUtil.readString(in));
        if (Utils.IS_TEST_MODE) {
          LOG.info("Loaded " + file.getPath());
        }
        files.add(file);
      }
    }
  }
  finally {
    unlockData();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:FilesDelta.java

示例4: skip

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public static void skip(DataInput in) throws IOException {
  int deletedCount = in.readInt();
  while (deletedCount-- > 0) {
    IOUtil.readString(in);
  }
  int recompiledCount = in.readInt();
  while (recompiledCount-- > 0) {
    IOUtil.readString(in);
    int filesCount = in.readInt();
    while (filesCount-- > 0) {
      IOUtil.readString(in);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:FilesDelta.java

示例5: load

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
private boolean load() {
  if (!myTargetsFile.exists()) {
    return false;
  }

  try {
    DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(myTargetsFile)));
    try {
      input.readInt();//reserved for version
      int size = input.readInt();
      BuildTargetLoader<?> loader = myTargetType.createLoader(myTargetsState.getModel());
      while (size-- > 0) {
        String stringId = IOUtil.readString(input);
        int intId = input.readInt();
        myTargetsState.markUsedId(intId);
        BuildTarget<?> target = loader.createTarget(stringId);
        if (target != null) {
          myTargetIds.put(target, intId);
        }
        else {
          LOG.info("Unknown " + myTargetType.getTypeId() + " target: " + stringId);
        }
      }
      return true;
    }
    finally {
      input.close();
    }
  }
  catch (IOException e) {
    LOG.info("Cannot load " + myTargetType.getTypeId() + " targets data: " + e.getMessage(), e);
    return false;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:BuildTargetTypeState.java

示例6: getModificationStamp

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public static long getModificationStamp(VirtualFile file) {
    long ret = -1;
    Long temporary = file.getUserData(Util.MODIFICATION_DATE_KEY);
    if(temporary == null || temporary <= 0) {
        if(file instanceof NewVirtualFile) {
            final DataInputStream is = MODIFICATION_STAMP_FILE_ATTRIBUTE.readAttribute(file);
            if(is != null) {
                try {
                    try {
                        if(is.available() > 0) {
                            String value = IOUtil.readString(is);
                            ret = convertToLong(value, ret);
                            if(ret > 0) {
                                file.putUserData(Util.MODIFICATION_DATE_KEY, ret);
                            }
                        }
                    } finally {
                        is.close();
                    }
                } catch(IOException e) {
                    // Ignore it but we might need to throw an exception
                    String message = e.getMessage();
                }
            }
        }
    } else {
        ret = temporary;
    }
    return ret;
}
 
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:31,代码来源:Util.java

示例7: load

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public void load(DataInput in, @NotNull BuildTarget<?> target, BuildRootIndex buildRootIndex) throws IOException {
  myDeletedPaths.clear();
  int deletedCount = in.readInt();
  while (deletedCount-- > 0) {
    myDeletedPaths.add(IOUtil.readString(in));
  }
  myFilesToRecompile.clear();
  int recompileCount = in.readInt();
  while (recompileCount-- > 0) {
    String rootId = IOUtil.readString(in);
    BuildRootDescriptor descriptor = target.findRootDescriptor(rootId, buildRootIndex);
    Set<File> files;
    if (descriptor != null) {
      files = myFilesToRecompile.get(descriptor);
      if (files == null) {
        files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
        myFilesToRecompile.put(descriptor, files);
      }
    }
    else {
      LOG.debug("Cannot find root by " + rootId + ", delta will be skipped");
      files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
    }
    int filesCount = in.readInt();
    while (filesCount-- > 0) {
      final File file = new File(IOUtil.readString(in));
      if (Utils.IS_TEST_MODE) {
        LOG.info("Loaded " + file.getPath());
      }
      files.add(file);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:34,代码来源:FilesDelta.java

示例8: read

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public Collection<String> read(DataInput in) throws IOException {
  final Set<String> result = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
  final DataInputStream stream = (DataInputStream)in;
  while (stream.available() > 0) {
    final String str = IOUtil.readString(stream);
    result.add(str);
  }
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:OneToManyPathsMapping.java

示例9: createValidityState

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public ValidityState createValidityState(DataInput in) throws IOException {
  return new DestinationFileInfo(IOUtil.readString(in), true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CopyingCompiler.java

示例10: GenericCompilerPersistentData

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public GenericCompilerPersistentData(File cacheStoreDirectory, int compilerVersion) throws IOException {
  myCompilerVersion = compilerVersion;
  myFile = new File(cacheStoreDirectory, "info");
  if (!myFile.exists()) {
    LOG.info("Compiler info file doesn't exists: " + myFile.getAbsolutePath());
    myVersionChanged = true;
    return;
  }

  try {
    DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(myFile)));
    try {
      final int dataVersion = input.readInt();
      if (dataVersion != VERSION) {
        LOG.info("Version of compiler info file (" + myFile.getAbsolutePath() + ") changed: " + dataVersion + " -> " + VERSION);
        myVersionChanged = true;
        return;
      }

      final int savedCompilerVersion = input.readInt();
      if (savedCompilerVersion != compilerVersion) {
        LOG.info("Compiler caches version changed (" + myFile.getAbsolutePath() + "): " + savedCompilerVersion + " -> " + compilerVersion);
        myVersionChanged = true;
        return;
      }

      int size = input.readInt();
      while (size-- > 0) {
        final String target = IOUtil.readString(input);
        final int id = input.readInt();
        myTarget2Id.put(target, id);
        myUsedIds.add(id);
      }
    }
    finally {
      input.close();
    }
  }
  catch (IOException e) {
    FileUtil.delete(myFile);
    throw e;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:GenericCompilerPersistentData.java

示例11: createValidityState

import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
@Override
public ValidityState createValidityState(DataInput in) throws IOException {
  return new DestinationFileInfo(IOUtil.readString(in), true);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:CopyingCompiler.java


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