From 583c46d36d7dc4bfebc84fcfdc48609fa541c734 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sat, 29 Jun 2013 17:01:35 +0000 Subject: [PATCH] SDK: - update image downloader for sdk manual git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10673 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- sdk/ant-jme/nbproject/build-impl.xml | 23 +++++++--- sdk/ant-jme/nbproject/genfiles.properties | 4 +- .../src/com/jme/ant/LoadWikiImages.java | 40 ++++++++++++------ sdk/ant-lib/ant-jme.jar | Bin 21117 -> 21317 bytes 4 files changed, 46 insertions(+), 21 deletions(-) diff --git a/sdk/ant-jme/nbproject/build-impl.xml b/sdk/ant-jme/nbproject/build-impl.xml index bd8965d6a..384c4859a 100644 --- a/sdk/ant-jme/nbproject/build-impl.xml +++ b/sdk/ant-jme/nbproject/build-impl.xml @@ -392,6 +392,11 @@ is divided into following sections: + + + + + @@ -415,7 +420,7 @@ is divided into following sections: - + @@ -425,7 +430,11 @@ is divided into following sections: - + + + + + @@ -548,7 +557,7 @@ is divided into following sections: - + @@ -558,7 +567,11 @@ is divided into following sections: - + + + + + @@ -930,7 +943,7 @@ is divided into following sections: - + diff --git a/sdk/ant-jme/nbproject/genfiles.properties b/sdk/ant-jme/nbproject/genfiles.properties index 940a52acd..d1ec873a3 100644 --- a/sdk/ant-jme/nbproject/genfiles.properties +++ b/sdk/ant-jme/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=dd1578ef -nbproject/build-impl.xml.script.CRC32=a6e22d49 -nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46 +nbproject/build-impl.xml.script.CRC32=53d14a5f +nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46 diff --git a/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java b/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java index d56556a9b..834d2205e 100644 --- a/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java +++ b/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java @@ -48,21 +48,33 @@ public class LoadWikiImages extends Task { } name = name.replaceAll(":", "/"); URL url = new URL(host + link); - InputStream in = url.openStream(); - File file = new File(getLocation().getFileName().replaceAll("build.xml", "") + File.separator + targetFolder + File.separator + name.replaceAll("/", File.separator)); - log("Getting image: " + host + link); - log("To: " + file); - File parent = file.getParentFile(); - parent.mkdirs(); - FileOutputStream out = new FileOutputStream(file); - int byte_ = in.read(); - while (byte_ != -1) { - out.write(byte_); - byte_ = in.read(); + InputStream in = null; + FileOutputStream out = null; + try { + + in = url.openStream(); + File file = new File(getLocation().getFileName().replaceAll("build.xml", "") + File.separator + targetFolder + File.separator + name.replaceAll("/", File.separator)); + log("Getting image: " + host + link); + log("To: " + file); + File parent = file.getParentFile(); + parent.mkdirs(); + out = new FileOutputStream(file); + int byte_ = in.read(); + while (byte_ != -1) { + out.write(byte_); + byte_ = in.read(); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (in != null) { + in.close(); + } + if (out != null) { + out.close(); + } } - in.close(); - out.close(); - }else if(extidx >= 0){ + } else if (extidx >= 0) { String name = link.replaceAll("/wiki/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", ""); int markIdx = name.indexOf("?"); if (markIdx >= 0) { diff --git a/sdk/ant-lib/ant-jme.jar b/sdk/ant-lib/ant-jme.jar index c90da5fa2f0e09c5c4a885155bf62656297272fa..9370efc25298389e9055facdf3b8434d8524782c 100644 GIT binary patch delta 2180 zcmZ`*YgANK6#mX(n7Q1!1LF(>4zI>gGe9skgb7G6AD|#FAC!s%A`ZfU<5-yGsHIq0 zMyJfgS7uR}5Tb)N6=q3kR+ej(YqeZGep;<%X+K&km+dn{FI(Lod+)RN+28&4zWb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