diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index ef633bd83a..fe6ea4205e 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -85,7 +85,7 @@ public class ClassicPluginStrategy implements PluginStrategy { boolean isLinked = archive.getName().endsWith(".hpl"); if (isLinked) { // resolve the .hpl file to the location of the manifest file - final String firstLine = IOUtils.readFirstLine(archive); + final String firstLine = IOUtils.readFirstLine(new FileInputStream(archive), "UTF-8"); if (firstLine.startsWith("Manifest-Version:")) { // this is the manifest already } else { diff --git a/core/src/main/java/hudson/util/IOUtils.java b/core/src/main/java/hudson/util/IOUtils.java index 5af4600741..975448dc58 100644 --- a/core/src/main/java/hudson/util/IOUtils.java +++ b/core/src/main/java/hudson/util/IOUtils.java @@ -122,17 +122,6 @@ public class IOUtils extends org.apache.commons.io.IOUtils { return PosixAPI.get().stat(f.getPath()).mode(); } - /** - * Read the first line of a file - * @param file - * @return the first line of a file - * @throws IOException - * @since 1.422 - */ - public static String readFirstLine(File file) throws IOException { - return readFirstLine(new FileInputStream(file),null); - } - /** * Read the first line of the given stream, close it, and return that line. *