Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ekaterina Tuzova
2014-01-23 18:38:44 +04:00
3 changed files with 152 additions and 5 deletions
@@ -29,6 +29,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
public class ExecUtil {
@@ -160,9 +161,17 @@ public class ExecUtil {
@Nullable
public static String execAndReadLine(final String... command) {
return execAndReadLine(null, command);
}
@Nullable
public static String execAndReadLine(@Nullable Charset charset, final String... command) {
try {
final Process process = new GeneralCommandLine(command).createProcess();
final BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
InputStream inputStream = process.getInputStream();
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
InputStreamReader in = charset == null ? new InputStreamReader(inputStream) : new InputStreamReader(inputStream, charset);
final BufferedReader reader = new BufferedReader(in);
try {
return reader.readLine();
}
@@ -114,6 +114,106 @@
"pluginId": "com.jetbrains.php",
"version": "133.326"
},
{
"updateId": 14011,
"pluginId": "NodeJS",
"version": "132.15"
},
{
"updateId": 14203,
"pluginId": "NodeJS",
"version": "132.324"
},
{
"updateId": 14375,
"pluginId": "NodeJS",
"version": "132.709"
},
{
"updateId": 14482,
"pluginId": "NodeJS",
"version": "132.944"
},
{
"updateId": 14516,
"pluginId": "NodeJS",
"version": "132.947"
},
{
"updateId": 14548,
"pluginId": "NodeJS",
"version": "132.1054"
},
{
"updateId": 14581,
"pluginId": "NodeJS",
"version": "133.50"
},
{
"updateId": 14595,
"pluginId": "NodeJS",
"version": "133.74"
},
{
"updateId": 14665,
"pluginId": "NodeJS",
"version": "133.134"
},
{
"updateId": 14693,
"pluginId": "NodeJS",
"version": "133.162"
},
{
"updateId": 14706,
"pluginId": "NodeJS",
"version": "133.195"
},
{
"updateId": 14707,
"pluginId": "NodeJS",
"version": "133.193"
},
{
"updateId": 14715,
"pluginId": "NodeJS",
"version": "133.168"
},
{
"updateId": 14790,
"pluginId": "NodeJS",
"version": "133.260"
},
{
"updateId": 14820,
"pluginId": "NodeJS",
"version": "133.293"
},
{
"updateId": 14868,
"pluginId": "NodeJS",
"version": "133.373"
},
{
"updateId": 14031,
"pluginId": "org.intellij.clojure",
"version": "0.7.34"
},
{
"updateId": 14076,
"pluginId": "org.intellij.clojure",
"version": "0.7.36"
},
{
"updateId": 14428,
"pluginId": "org.intellij.clojure",
"version": "0.7.57"
},
{
"updateId": 14604,
"pluginId": "org.intellij.clojure",
"version": "0.7.60"
},
{
"updateId": 8976,
"pluginId": "org.intellij.scala",
@@ -268,5 +368,25 @@
"updateId": 14812,
"pluginId": "org.jetbrains.plugins.ruby",
"version": "6.0.0.20131207"
},
{
"updateId": 14036,
"pluginId": "Pythonid",
"version": "2.11.2"
},
{
"updateId": 14295,
"pluginId": "Pythonid",
"version": "3.0.1"
},
{
"updateId": 14654,
"pluginId": "Pythonid",
"version": "3.1 Beta"
},
{
"updateId": 14824,
"pluginId": "Pythonid",
"version": "3.1 Beta 2"
}
]
]
@@ -1353,14 +1353,32 @@ public class FileUtil extends FileUtilRt {
return loadLines(file.getPath());
}
@NotNull
public static List<String> loadLines(@NotNull File file, @Nullable @NonNls String encoding) throws IOException {
return loadLines(file.getPath(), encoding);
}
@NotNull
public static List<String> loadLines(@NotNull String path) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(path));
return loadLines(path, null);
}
@NotNull
public static List<String> loadLines(@NotNull String path, @Nullable @NonNls String encoding) throws IOException {
InputStream stream = new FileInputStream(path);
try {
return loadLines(reader);
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
InputStreamReader in = encoding == null ? new InputStreamReader(stream) : new InputStreamReader(stream, encoding);
BufferedReader reader = new BufferedReader(in);
try {
return loadLines(reader);
}
finally {
reader.close();
}
}
finally {
reader.close();
stream.close();
}
}