From 3b154312c8aa5b0210bced18bc5aeffb60b0376d Mon Sep 17 00:00:00 2001 From: Christoph Kutzinski Date: Sat, 23 Jul 2011 23:45:43 +0200 Subject: [PATCH] deleted encoding-less variant of readFirstLine according to https://github.com/jenkinsci/jenkins/commit/4ee8d6890c354e67daeb5f55806c16f6986b32c3#core/src/main/java/hudson/util/IOUtils.java-P13 --- core/src/main/java/hudson/ClassicPluginStrategy.java | 2 +- core/src/main/java/hudson/util/IOUtils.java | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) 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. *