Java Code Examples for com.intellij.util.io.IOUtil#writeString()

The following examples show how to use com.intellij.util.io.IOUtil#writeString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Util.java    From aem-ide-tooling-4-intellij with Apache License 2.0 6 votes vote down vote up
@Override
public boolean visitFile(VirtualFile file) {
    file.putUserData(MODIFICATION_DATE_KEY, null);
    if(file instanceof NewVirtualFile) {
        final DataOutputStream os = MODIFICATION_STAMP_FILE_ATTRIBUTE.writeAttribute(file);
        try {
            try {
                IOUtil.writeString(StringUtil.notNullize("0"), os);
            } finally {
                os.close();
            }
        } catch(IOException e) {
            // Ignore it but we might need to throw an exception
            String message = e.getMessage();
        }
    }
    return recursive;
}
 
Example 2
Source File: Util.java    From aem-ide-tooling-4-intellij with Apache License 2.0 6 votes vote down vote up
public static void setModificationStamp(VirtualFile file) {
    // Store it in memory first
    if(file != null) {
        file.putUserData(Util.MODIFICATION_DATE_KEY, file.getTimeStamp());
        if(file instanceof NewVirtualFile) {
            final DataOutputStream os = MODIFICATION_STAMP_FILE_ATTRIBUTE.writeAttribute(file);
            try {
                try {
                    IOUtil.writeString(StringUtil.notNullize(file.getTimeStamp() + ""), os);
                } finally {
                    os.close();
                }
            } catch(IOException e) {
                // Ignore it but we might need to throw an exception
                String message = e.getMessage();
            }
        }
    }
}
 
Example 3
Source File: GenericCompilerPersistentData.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void save() throws IOException {
  final DataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(myFile)));
  try {
    output.writeInt(VERSION);
    output.writeInt(myCompilerVersion);
    output.writeInt(myTarget2Id.size());

    for (Map.Entry<String, Integer> entry : myTarget2Id.entrySet()) {
      IOUtil.writeString(entry.getKey(), output);
      output.writeInt(entry.getValue());
    }
  }
  finally {
    output.close();
  }
}
 
Example 4
Source File: ForcedBuildFileAttribute.java    From consulo with Apache License 2.0 6 votes vote down vote up
private static void forceBuildFile(VirtualFile file, @Nullable String value) {
  if (file instanceof NewVirtualFile) {
    final DataOutputStream os = FRAMEWORK_FILE_ATTRIBUTE.writeAttribute(file);
    try {
      try {
        IOUtil.writeString(StringUtil.notNullize(value), os);
      }
      finally {
        os.close();
      }
    }
    catch (IOException e) {
      LOG.error(e);
    }
  }
  else {
    file.putUserData(FRAMEWORK_FILE_MARKER, value);
  }
}
 
Example 5
Source File: FileUtil.java    From jetbrains-plugin-graph-database-support with Apache License 2.0 5 votes vote down vote up
public static void setParams(VirtualFile file, String params) {
    file.putUserData(MY_KEY, params);
    if (file instanceof NewVirtualFile) {
        try (DataOutputStream os = QUERY_PARAMS_FILE_ATTRIBUTE.writeAttribute(file)) {
            IOUtil.writeString(StringUtil.notNullize(params), os);
        } catch (IOException e) {
        }
    }
}
 
Example 6
Source File: CopyingCompiler.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void save(DataOutput out) throws IOException {
  IOUtil.writeString(destinationPath, out);
}