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 3518 Details for
Bug 2869
[Editor Mgmt] EC: Editing a file outside the workspace (1GK7OZS)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
FileStorage class to represent a file not in the workspace, can be passed to ExternalEditorInput.
FileStorage.java (text/plain), 2.29 KB, created by
Ed Burnette
on 2003-02-15 16:04:55 EST
(
hide
)
Description:
FileStorage class to represent a file not in the workspace, can be passed to ExternalEditorInput.
Filename:
MIME Type:
Creator:
Ed Burnette
Created:
2003-02-15 16:04:55 EST
Size:
2.29 KB
patch
obsolete
>package org.eclipse.core.resources; > >/* > * (c) Copyright QNX Software Systems Ltd. 2002. > * All Rights Reserved. > */ > >import java.io.InputStream; >import java.io.FileInputStream; >import java.io.FileNotFoundException; > >import org.eclipse.core.resources.IStorage; >import org.eclipse.core.runtime.IPath; >import org.eclipse.core.runtime.PlatformObject; >import org.eclipse.core.runtime.CoreException; >import org.eclipse.core.runtime.Status; >import org.eclipse.core.runtime.IStatus; > >import com.sas.dev.ddt.ui.DdtPlugin; > >/** > * > * @see IStorage > */ >public class FileStorage extends PlatformObject implements IStorage { > IPath path; > InputStream in = null; > > /** > * Two FileStorages are equal if their IPaths are equal. > * @see java.lang.Object#equals(java.lang.Object) > */ > public boolean equals(Object obj) { > if (this == obj) > return true; > if (!(obj instanceof FileStorage)) > return false; > FileStorage other = (FileStorage)obj; > return path.equals(other.path); > } > > /** > * @see org.eclipse.core.resources.IStorage#getContents() > */ > public InputStream getContents() throws CoreException { > if (in == null) { > try { > return new FileInputStream(path.toFile()); > } catch (FileNotFoundException e) { > throw new CoreException(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, > IStatus.ERROR, e.toString(), e)); > } > } else { > return in; > } > } > > /** > * @see IStorage#getFullPath > */ > public IPath getFullPath() { > return this.path; > } > > /** > * @see IStorage#getName > */ > public String getName() { > return this.path.lastSegment(); > } > > /** > * @see IStorage#isReadOnly() > */ > public boolean isReadOnly() { > return true; > } > > /** > * Method FileStorage. > * @param path > */ > public FileStorage(IPath path){ > this.path = path; > } > > /** > * Method FileStorage. > * @param in > * @param path > */ > public FileStorage(InputStream in, IPath path){ > this.path = path; > this.in = in; > } > > /** > * @see IStorage#isReadOnly() > */ > public String toString() { > return path.toOSString(); > } >}
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 Raw
Actions:
View
Attachments on
bug 2869
:
3517
| 3518