use of com.intellij.cvsSupport2.javacvsImpl.FileReadOnlyHandler in project intellij-community by JetBrains.
the class CvsCommandOperation method createEnvironment.
private IClientEnvironment createEnvironment(IConnection connection, final CvsRootProvider root, UpdatedFilesManager mergedFilesCollector, CvsExecutionEnvironment cvsExecutionEnv) {
final File localRoot = getLocalRootFor(root);
final File adminRoot = getAdminRootFor(root);
LOG.assertTrue(localRoot != null, getClass().getName());
LOG.assertTrue(adminRoot != null, getClass().getName());
return new ClientEnvironment(connection, localRoot, adminRoot, root.getCvsRoot(), createLocalFileReader(), createLocalFileWriter(root.getCvsRootAsString(), mergedFilesCollector, cvsExecutionEnv), myAdminReader, myAdminWriter, getIgnoreFileFilter(), new FileReadOnlyHandler(), CvsApplicationLevelConfiguration.getCharset());
}
use of com.intellij.cvsSupport2.javacvsImpl.FileReadOnlyHandler in project intellij-community by JetBrains.
the class CvsFileUtil method storeLines.
public static void storeLines(List<String> lines, File file) throws IOException {
String separator = getLineSeparatorFor(file);
FileUtil.createIfDoesntExist(file);
if (!file.canWrite()) {
new FileReadOnlyHandler().setFileReadOnly(file, false);
}
Writer writer = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file)), CvsApplicationLevelConfiguration.getCharset());
try {
for (final String line : lines) {
writer.write(line);
writer.write(separator);
}
} finally {
writer.close();
}
}
Aggregations