Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 258166 - [composite repo] CompositeArtifactRepository.getOutputStream returns null
Summary: [composite repo] CompositeArtifactRepository.getOutputStream returns null
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Andrew Cattle CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-09 15:05 EST by Andrew Cattle CLA
Modified: 2008-12-17 08:12 EST (History)
3 users (show)

See Also:


Attachments
Throws UnsupportedOperationException when getOutputStream is called on a CAR (5.01 KB, patch)
2008-12-11 10:05 EST, Andrew Cattle CLA
dj.houghton: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cattle CLA 2008-12-09 15:05:36 EST
The IArtifactRepository interface defines getOutputStream as:
Open an output stream to which a client can write the data for the given 
artifact descriptor.

And further states:
@return the stream to which the artifact content can be written.

The implementation in AbstractArtifactRepository simple performs an "isModifiable" check then returns null.

CompositeArtifactRepository uses the implementation from AbstractArtifactRepository so any call to getOutputStream will result in either an exception (if the repository is not modifiable) or null.

However, while it is possible for a CAR to be modifiable (say, when modifying properties and adding/removing children), we have stated that it cannot have its own descriptors, and therefore should throw an exception.
Comment 1 Andrew Cattle CLA 2008-12-09 15:33:16 EST
In relation to Bug 258173, I feel CAR should throw their own error saying that that method is not supported, as opposed to a more generic "method not implemented." Of course, it depends on what the solution to Bug 258173 is.
Comment 2 Andrew Cattle CLA 2008-12-11 10:05:02 EST
Created attachment 120202 [details]
Throws UnsupportedOperationException when getOutputStream is called on a CAR

Updates externalized strings.
Comment 3 DJ Houghton CLA 2008-12-17 08:11:57 EST
Released to HEAD.