This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 22438
Collapse All | Expand All

(-)JarChildren.java (-15 / +25 lines)
Lines 279-301 Link Here
279
            }
279
            }
280
            public Transferable paste() {
280
            public Transferable paste() {
281
                //                System.out.println("do paste stuff here!!");
281
                //                System.out.println("do paste stuff here!!");
282
                
283
                FileLock lock=null;
284
                try {
282
                try {
285
                    FileInputStream is = new FileInputStream(generatedJar);
283
                    FileSystem fs = target.getFileSystem();
286
                    FileObject tf = FileUtil.createData(target,generatedJar.getName());
284
                    fs.runAtomicAction (new FileSystem.AtomicAction () {
287
                    lock = tf.lock();
285
                        public void run () throws IOException {
288
                    OutputStream os = tf.getOutputStream(lock);
286
                            FileLock lock=null;
289
                    FileUtil.copy(is,os);
287
                            try {
290
                    lock.releaseLock();
288
                                FileInputStream is = new FileInputStream(generatedJar);
291
                    return null;
289
                                FileObject tf = FileUtil.createData(target,generatedJar.getName());
290
                                lock = tf.lock();
291
                                OutputStream os = tf.getOutputStream(lock);
292
                                FileUtil.copy(is,os);
293
                                lock.releaseLock();
294
                                //return null;
295
                            }
296
                            catch (IOException ioe) {
297
                                TopManager.getDefault().getErrorManager().notify(ErrorManager.INFORMATIONAL, ioe);
298
                            }
299
                            finally {
300
                                if (lock!=null)
301
                                    lock.releaseLock();
302
                            }
303
                        //return null;
304
                        }
305
                    }); // end of AtomicAction
292
                }
306
                }
293
                catch (java.io.IOException ioe) {
307
                catch (IOException ioe) {
294
                    ioe.printStackTrace();
308
                    TopManager.getDefault().getErrorManager().notify(ErrorManager.INFORMATIONAL, ioe);
295
                }
296
                finally {
297
                    if (lock!=null)
298
                        lock.releaseLock();
299
                }
309
                }
300
                return null;
310
                return null;
301
            }
311
            }

Return to bug 22438