Lines 89-104
Link Here
|
89 |
private static void copyResourceToFile(String from, File to) |
89 |
private static void copyResourceToFile(String from, File to) |
90 |
throws IOException { |
90 |
throws IOException { |
91 |
InputStream is = TextExportFormat.class.getResourceAsStream(from); |
91 |
InputStream is = TextExportFormat.class.getResourceAsStream(from); |
92 |
try { |
92 |
if (is != null) { |
93 |
OutputStream os = new FileOutputStream(to); |
93 |
try { |
94 |
try { |
94 |
OutputStream os = new FileOutputStream(to); |
95 |
UTUtils.copyStream(is, os); |
95 |
try { |
96 |
} finally { |
96 |
UTUtils.copyStream(is, os); |
97 |
os.close(); |
97 |
} finally { |
98 |
} |
98 |
os.close(); |
99 |
} finally { |
99 |
} |
100 |
is.close(); |
100 |
} finally { |
|
|
101 |
is.close(); |
102 |
} |
101 |
} |
103 |
} |
|
|
104 |
else { |
105 |
UTUtils.LOGGER.log(Level.SEVERE, "Could not find resource \"" + from + "\""); |
106 |
} |
102 |
} |
107 |
} |
103 |
|
108 |
|
104 |
private String res = "usertasks-effort-html.xsl"; // NOI18N |
109 |
private String res = "usertasks-effort-html.xsl"; // NOI18N |
Lines 215-224
Link Here
|
215 |
super.doExportImport(provider, wd); |
220 |
super.doExportImport(provider, wd); |
216 |
try { |
221 |
try { |
217 |
copyResourceToFile( |
222 |
copyResourceToFile( |
218 |
"/org/netbeans/modules/tasklist/core/task.gif", // NOI18N |
223 |
"/org/netbeans/modules/tasklist/usertasks/task.gif", // NOI18N |
219 |
new File(dir, "undone.gif")); // NOI18N |
224 |
new File(dir, "undone.gif")); // NOI18N |
220 |
copyResourceToFile( |
225 |
copyResourceToFile( |
221 |
"/org/netbeans/modules/tasklist/core/doneItem.gif", // NOI18N |
226 |
"/org/netbeans/modules/tasklist/usertasks/doneItem.gif", // NOI18N |
222 |
new File(dir, "done.gif")); // NOI18N |
227 |
new File(dir, "done.gif")); // NOI18N |
223 |
} catch (IOException ex) { |
228 |
} catch (IOException ex) { |
224 |
NotifyDescriptor nd = new NotifyDescriptor.Message(ex.getMessage(), |
229 |
NotifyDescriptor nd = new NotifyDescriptor.Message(ex.getMessage(), |