diff options
Diffstat (limited to 'org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java')
-rw-r--r-- | org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java index 283c461fc..d3f42a73b 100644 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java +++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java @@ -36,24 +36,25 @@ import org.eclipse.core.runtime.Status; * Implementation of an in memory file store to test launch configurations on EFS */ public class DebugFileStore extends FileStore { - + /** * Output steam for writing a file */ class DebugOutputStream extends ByteArrayOutputStream { - + /* (non-Javadoc) * @see java.io.ByteArrayOutputStream#close() */ + @Override public void close() throws IOException { super.close(); DebugFileSystem.getDefault().setContents(toURI(), toByteArray()); } - + } - + private final URI uri; - + public DebugFileStore(URI id) { uri = id; } @@ -61,9 +62,10 @@ public class DebugFileStore extends FileStore { /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#childNames(int, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public String[] childNames(int options, IProgressMonitor monitor) throws CoreException { URI[] uris = DebugFileSystem.getDefault().getFileURIs(); - List children = new ArrayList(); + List<String> children = new ArrayList<String>(); IPath me = getPath(); for (int i = 0; i < uris.length; i++) { URI id = uris[i]; @@ -74,12 +76,13 @@ public class DebugFileStore extends FileStore { } } } - return (String[]) children.toArray(new String[children.size()]); + return children.toArray(new String[children.size()]); } /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#fetchInfo(int, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException { byte[] contents = DebugFileSystem.getDefault().getContents(toURI()); FileInfo info = new FileInfo(); @@ -102,6 +105,7 @@ public class DebugFileStore extends FileStore { /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#getChild(java.lang.String) */ + @Override public IFileStore getChild(String name) { try { return new DebugFileStore(new URI(getFileSystem().getScheme(), getPath().append(name).toString(), null)); @@ -113,6 +117,7 @@ public class DebugFileStore extends FileStore { /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#getName() */ + @Override public String getName() { IPath path = getPath(); if (path.segmentCount() > 0) { @@ -133,6 +138,7 @@ public class DebugFileStore extends FileStore { /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#getParent() */ + @Override public IFileStore getParent() { IPath path = getPath(); if (path.segmentCount() > 0) { @@ -147,6 +153,7 @@ public class DebugFileStore extends FileStore { /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#openInputStream(int, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException { byte[] contents = DebugFileSystem.getDefault().getContents(toURI()); if (contents != null) { @@ -155,17 +162,19 @@ public class DebugFileStore extends FileStore { throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jdt.debug.tests", //$NON-NLS-1$ "File does not exist: " + toURI())); //$NON-NLS-1$ } - + /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#openOutputStream(int, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public OutputStream openOutputStream(int options, IProgressMonitor monitor) throws CoreException { return new DebugOutputStream(); } - + /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#mkdir(int, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException { IFileInfo info = fetchInfo(); if (info.exists()) { @@ -192,6 +201,7 @@ public class DebugFileStore extends FileStore { /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#toURI() */ + @Override public URI toURI() { return uri; } @@ -199,6 +209,7 @@ public class DebugFileStore extends FileStore { /* (non-Javadoc) * @see org.eclipse.core.filesystem.provider.FileStore#delete(int, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void delete(int options, IProgressMonitor monitor) throws CoreException { DebugFileSystem.getDefault().delete(toURI()); } |