Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1 from escoem/JENKINS-19090
JENKINS-19090 can't delete the project
  • Loading branch information
zhaozhiming committed Dec 1, 2016
2 parents 4cb5aee + 90790e4 commit 86a0918
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/jenkins/plugins/util/ReadUtil.java
Expand Up @@ -19,15 +19,25 @@ public class ReadUtil {
private static final Logger LOGGER = Logger.getLogger(ReadUtil.class.getName());

public static Properties getJobProperties(Job job) {
FileInputStream fs = null;
try {
File rootDir = job.getRootDir();
File file = new File(rootDir.getAbsolutePath() + File.separator + StoreUtil.BANGKOU_PROPERTIES);
fs = new FileInputStream(file);
Properties properties = new Properties();
properties.load(new FileInputStream(file));
properties.load(fs);
return properties;
} catch (IOException e) {
LOGGER.warning(String.format("get property file error : %s", e.getMessage()));
return null;
} finally {
if (fs != null) {
try {
fs.close();
} catch (IOException e) {
LOGGER.warning(String.format("error while closing the stream: %s", e.getMessage()));
}
}
}
}

Expand Down

0 comments on commit 86a0918

Please sign in to comment.