Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 82592 Details for
Bug 209327
[api] add additional IO support to import/export of tasks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to add two new methods to TaskListWriter that takes an OutputStream.
outputstream-patch.txt (text/plain), 2.38 KB, created by
Remy Suen
on 2007-11-09 21:39:15 EST
(
hide
)
Description:
Patch to add two new methods to TaskListWriter that takes an OutputStream.
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2007-11-09 21:39:15 EST
Size:
2.38 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java,v >retrieving revision 1.40 >diff -u -r1.40 TaskListWriter.java >--- src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java 20 Sep 2007 19:49:31 -0000 1.40 >+++ src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java 10 Nov 2007 02:37:22 -0000 >@@ -114,6 +114,14 @@ > } > > public void writeTaskList(TaskList taskList, File outFile) { >+ try { >+ writeTaskList(taskList, new FileOutputStream(outFile)); >+ } catch (Exception fnfe) { >+ StatusHandler.log(fnfe, "TaskList could not be found"); >+ } >+ } >+ >+ public void writeTaskList(TaskList taskList, OutputStream outputStream) { > Document doc = createTaskListDocument(); > if (doc == null) { > return; >@@ -168,7 +176,7 @@ > } > > // doc.appendChild(root); >- writeDOMtoFile(doc, outFile); >+ writeDOMtoFile(doc, outputStream); > return; > } > >@@ -198,9 +206,9 @@ > * > * doc - the document to write file - the file to be written to > */ >- private void writeDOMtoFile(Document doc, File file) { >+ private void writeDOMtoFile(Document doc, OutputStream stream) { > try { >- ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream(file)); >+ ZipOutputStream outputStream = new ZipOutputStream(stream); > writeTaskList(doc, outputStream); > outputStream.close(); > } catch (Exception fnfe) { >@@ -646,6 +654,14 @@ > } > > public void writeTask(AbstractTask task, File outFile) { >+ try { >+ writeTask(task, new FileOutputStream(outFile)); >+ } catch (Exception e) { >+ StatusHandler.log(e, "Task data was not written"); >+ } >+ } >+ >+ public void writeTask(AbstractTask task, OutputStream stream) { > Set<TaskRepository> repositories = new HashSet<TaskRepository>(); > if (!task.isLocal()) { > repositories.add(TasksUiPlugin.getRepositoryManager().getRepository(task.getRepositoryUrl())); >@@ -660,7 +676,7 @@ > > delagatingExternalizer.createTaskElement(task, doc, root); > try { >- ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream(outFile)); >+ ZipOutputStream outputStream = new ZipOutputStream(stream); > // write task data > writeTaskList(doc, outputStream); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 209327
: 82592 |
82593
|
88957