1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

[cleanup] Fix Javadoc Warning

This commit is contained in:
Martin Oberhuber 2008-05-19 13:01:04 +00:00
parent 71984b05ab
commit 4120cbbdf6

View file

@ -1,15 +1,15 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Kushal Munir (IBM) - moved to internal package * Kushal Munir (IBM) - moved to internal package
* Martin Oberhuber (Wind River) - [181917] EFS Improvements: Avoid unclosed Streams, * Martin Oberhuber (Wind River) - [181917] EFS Improvements: Avoid unclosed Streams,
@ -65,7 +65,7 @@ import org.eclipse.rse.ui.RSEUIPlugin;
/** /**
* Implementation of IFileStore for RSE. * Implementation of IFileStore for RSE.
* *
* The RSEFileStore delegates to this impl class in order to defer class * The RSEFileStore delegates to this impl class in order to defer class
* loading until file contents are really needed. * loading until file contents are really needed.
*/ */
@ -86,7 +86,7 @@ public class RSEFileStoreImpl extends FileStore
public RSEFileStoreImpl(RSEFileStore store) { public RSEFileStoreImpl(RSEFileStore store) {
_store = store; _store = store;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.core.filesystem.IFileStore#getChild(java.lang.String) * @see org.eclipse.core.filesystem.IFileStore#getChild(java.lang.String)
@ -124,7 +124,7 @@ public class RSEFileStoreImpl extends FileStore
*/ */
private static void waitForRSEInit() { private static void waitForRSEInit() {
if (!_initialized) { if (!_initialized) {
//Force activating RSEUIPlugin, which kicks off InitRSEJob //Force activating RSEUIPlugin, which kicks off InitRSEJob
RSEUIPlugin.getDefault(); RSEUIPlugin.getDefault();
Job[] jobs = Job.getJobManager().find(null); Job[] jobs = Job.getJobManager().find(null);
for (int i=0; i<jobs.length; i++) { for (int i=0; i<jobs.length; i++) {
@ -139,10 +139,10 @@ public class RSEFileStoreImpl extends FileStore
_initialized = true; _initialized = true;
} }
} }
/** /**
* Return the best RSE connection object matching the given host name. * Return the best RSE connection object matching the given host name.
* *
* @param hostNameOrAddr IP address of requested host. * @param hostNameOrAddr IP address of requested host.
* @return RSE connection object matching the given host name, or * @return RSE connection object matching the given host name, or
* <code>null</code> if no matching connection object was found. * <code>null</code> if no matching connection object was found.
@ -159,9 +159,9 @@ public class RSEFileStoreImpl extends FileStore
IHost unconnected = null; IHost unconnected = null;
for (int i = 0; i < connections.length; i++) { for (int i = 0; i < connections.length; i++) {
IHost con = connections[i]; IHost con = connections[i];
//TODO use more elaborate methods of checking whether two //TODO use more elaborate methods of checking whether two
//host names/IP addresses are the same; or, use the host alias //host names/IP addresses are the same; or, use the host alias
if (hostNameOrAddr.equalsIgnoreCase(con.getHostName())) { if (hostNameOrAddr.equalsIgnoreCase(con.getHostName())) {
@ -173,22 +173,24 @@ public class RSEFileStoreImpl extends FileStore
} }
} }
} }
return unconnected; return unconnected;
} }
/** /**
* Return the best available remote file subsystem for a connection. * Return the best available remote file subsystem for a connection.
* Criteria are: * Criteria are:
* <ol> * <ol>
* <li>A connected FileServiceSubsystem</li> * <li>A connected FileServiceSubsystem</li>
* <li>A connected IRemoteFileSubSystem</li> * <li>A connected IRemoteFileSubSystem</li>
* <li>An unconnected FileServiceSubsystem</li> * <li>An unconnected FileServiceSubsystem</li>
* <li>An unconnected IRemoteFileSubSystem</li> * <li>An unconnected IRemoteFileSubSystem</li>
* </ol> * </ol>
* @param host *
* @return an IRemoteFileSubSystem for the given connection, or * @param host the connection to check
* <code>null</code> if no IRemoteFileSubSystem is configured. * @return an IRemoteFileSubSystem for the given connection, or
* <code>null</code> if no IRemoteFileSubSystem is configured.
*/ */
public static IRemoteFileSubSystem getRemoteFileSubSystem(IHost host) { public static IRemoteFileSubSystem getRemoteFileSubSystem(IHost host) {
IRemoteFileSubSystem candidate = null; IRemoteFileSubSystem candidate = null;
@ -229,7 +231,7 @@ public class RSEFileStoreImpl extends FileStore
{ {
IHost con = RSEFileStoreImpl.getConnectionFor(hostNameOrAddr, monitor); IHost con = RSEFileStoreImpl.getConnectionFor(hostNameOrAddr, monitor);
if (con == null) { if (con == null) {
throw new CoreException(new Status(IStatus.ERROR, throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(), Activator.getDefault().getBundle().getSymbolicName(),
NLS.bind(Messages.CONNECTION_NOT_FOUND, hostNameOrAddr))); NLS.bind(Messages.CONNECTION_NOT_FOUND, hostNameOrAddr)));
} }
@ -254,7 +256,7 @@ public class RSEFileStoreImpl extends FileStore
} }
/** /**
* Return the cached IRemoteFile handle. Used only as a handle into * Return the cached IRemoteFile handle. Used only as a handle into
* ISubSystem operations, attributes of this handle are never considered * ISubSystem operations, attributes of this handle are never considered
* except for exists() checking. * except for exists() checking.
* @return * @return
@ -262,12 +264,12 @@ public class RSEFileStoreImpl extends FileStore
private IRemoteFile getCachedRemoteFile() { private IRemoteFile getCachedRemoteFile() {
return _remoteFile; return _remoteFile;
} }
private void cacheRemoteFile(IRemoteFile remoteFile) { private void cacheRemoteFile(IRemoteFile remoteFile) {
//if (_remoteFile != remoteFile) _remoteFile = remoteFile; //if (_remoteFile != remoteFile) _remoteFile = remoteFile;
_remoteFile = remoteFile; _remoteFile = remoteFile;
} }
/** /**
* Returns an IRemoteFile for this file store. * Returns an IRemoteFile for this file store.
* Requires that the file subsystem is connected. * Requires that the file subsystem is connected.
@ -293,7 +295,7 @@ public class RSEFileStoreImpl extends FileStore
//Handle was created naming a parent file store //Handle was created naming a parent file store
IRemoteFile parent = parentStore.getImpl().getRemoteFileObject(monitor, forceExists); IRemoteFile parent = parentStore.getImpl().getRemoteFileObject(monitor, forceExists);
if (parent==null) { if (parent==null) {
throw new CoreException(new Status(IStatus.ERROR, throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(), Activator.getDefault().getBundle().getSymbolicName(),
Messages.COULD_NOT_GET_REMOTE_FILE)); Messages.COULD_NOT_GET_REMOTE_FILE));
} }
@ -312,8 +314,8 @@ public class RSEFileStoreImpl extends FileStore
} }
catch (SystemMessageException e) { catch (SystemMessageException e) {
throw new CoreException(new Status( throw new CoreException(new Status(
IStatus.ERROR, IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(), Activator.getDefault().getBundle().getSymbolicName(),
getExceptionMessage(null, e), e)); getExceptionMessage(null, e), e));
} }
} }
@ -326,13 +328,13 @@ public class RSEFileStoreImpl extends FileStore
} }
return remoteFile; return remoteFile;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.core.filesystem.IFileStore#childNames(int, org.eclipse.core.runtime.IProgressMonitor) * @see org.eclipse.core.filesystem.IFileStore#childNames(int, org.eclipse.core.runtime.IProgressMonitor)
*/ */
public String[] childNames(int options, IProgressMonitor monitor) throws CoreException { public String[] childNames(int options, IProgressMonitor monitor) throws CoreException {
String[] names; String[] names;
IRemoteFile remoteFile = getRemoteFileObject(monitor, true); IRemoteFile remoteFile = getRemoteFileObject(monitor, true);
IRemoteFileSubSystem subSys = remoteFile.getParentRemoteFileSubSystem(); IRemoteFileSubSystem subSys = remoteFile.getParentRemoteFileSubSystem();
@ -340,7 +342,7 @@ public class RSEFileStoreImpl extends FileStore
{ {
Object[] children = remoteFile.getContents(RemoteChildrenContentsType.getInstance()); Object[] children = remoteFile.getContents(RemoteChildrenContentsType.getInstance());
names = new String[children.length]; names = new String[children.length];
for (int i = 0; i < children.length; i++) for (int i = 0; i < children.length; i++)
{ {
names[i] = ((IRemoteFile)children[i]).getName(); names[i] = ((IRemoteFile)children[i]).getName();
@ -350,7 +352,7 @@ public class RSEFileStoreImpl extends FileStore
{ {
try { try {
IRemoteFile[] children = null; IRemoteFile[] children = null;
if (subSys instanceof FileServiceSubSystem) { if (subSys instanceof FileServiceSubSystem) {
FileServiceSubSystem fileServiceSubSystem = ((FileServiceSubSystem)subSys); FileServiceSubSystem fileServiceSubSystem = ((FileServiceSubSystem)subSys);
IHostFile[] results = fileServiceSubSystem.getFileService().list(remoteFile.getAbsolutePath(), "*", IFileService.FILE_TYPE_FILES_AND_FOLDERS, monitor); //$NON-NLS-1$ IHostFile[] results = fileServiceSubSystem.getFileService().list(remoteFile.getAbsolutePath(), "*", IFileService.FILE_TYPE_FILES_AND_FOLDERS, monitor); //$NON-NLS-1$
@ -362,43 +364,43 @@ public class RSEFileStoreImpl extends FileStore
children = fileServiceSubSystem.getHostFileToRemoteFileAdapter().convertToRemoteFiles(fileServiceSubSystem, context, remoteFile, results); children = fileServiceSubSystem.getHostFileToRemoteFileAdapter().convertToRemoteFiles(fileServiceSubSystem, context, remoteFile, results);
} }
else { else {
children = subSys.list(remoteFile, monitor); children = subSys.list(remoteFile, monitor);
} }
names = new String[children.length]; names = new String[children.length];
for (int i = 0; i < children.length; i++) { for (int i = 0; i < children.length; i++) {
names[i] = (children[i]).getName(); names[i] = (children[i]).getName();
} }
} }
catch (SystemMessageException e) { catch (SystemMessageException e) {
names = new String[0]; names = new String[0];
} }
} }
return names; return names;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.core.filesystem.IFileStore#childInfos(int, org.eclipse.core.runtime.IProgressMonitor) * @see org.eclipse.core.filesystem.IFileStore#childInfos(int, org.eclipse.core.runtime.IProgressMonitor)
*/ */
public IFileInfo[] childInfos(int options, IProgressMonitor monitor) throws CoreException { public IFileInfo[] childInfos(int options, IProgressMonitor monitor) throws CoreException {
FileInfo[] infos; FileInfo[] infos;
IRemoteFile remoteFile = getRemoteFileObject(monitor, true); IRemoteFile remoteFile = getRemoteFileObject(monitor, true);
IRemoteFileSubSystem subSys = remoteFile.getParentRemoteFileSubSystem(); IRemoteFileSubSystem subSys = remoteFile.getParentRemoteFileSubSystem();
if (!remoteFile.isStale() && remoteFile.hasContents(RemoteChildrenContentsType.getInstance()) && !(subSys instanceof IFileServiceSubSystem)) if (!remoteFile.isStale() && remoteFile.hasContents(RemoteChildrenContentsType.getInstance()) && !(subSys instanceof IFileServiceSubSystem))
{ {
Object[] children = remoteFile.getContents(RemoteChildrenContentsType.getInstance()); Object[] children = remoteFile.getContents(RemoteChildrenContentsType.getInstance());
infos = new FileInfo[children.length]; infos = new FileInfo[children.length];
for (int i = 0; i < children.length; i++) for (int i = 0; i < children.length; i++)
{ {
IRemoteFile file = (IRemoteFile)(children[i]); IRemoteFile file = (IRemoteFile)(children[i]);
FileInfo info = new FileInfo(file.getName()); FileInfo info = new FileInfo(file.getName());
if (!file.exists()) { if (!file.exists()) {
info.setExists(false); info.setExists(false);
} }
@ -416,16 +418,16 @@ public class RSEFileStoreImpl extends FileStore
info.setLength(file.getLength()); info.setLength(file.getLength());
} }
} }
infos[i] = info; infos[i] = info;
} }
} }
else else
{ {
try { try {
IRemoteFile[] children = null; IRemoteFile[] children = null;
if (subSys instanceof FileServiceSubSystem) { if (subSys instanceof FileServiceSubSystem) {
FileServiceSubSystem fileServiceSubSystem = ((FileServiceSubSystem)subSys); FileServiceSubSystem fileServiceSubSystem = ((FileServiceSubSystem)subSys);
IHostFile[] results = fileServiceSubSystem.getFileService().list(remoteFile.getAbsolutePath(), "*", IFileService.FILE_TYPE_FILES_AND_FOLDERS, monitor); //$NON-NLS-1$ IHostFile[] results = fileServiceSubSystem.getFileService().list(remoteFile.getAbsolutePath(), "*", IFileService.FILE_TYPE_FILES_AND_FOLDERS, monitor); //$NON-NLS-1$
@ -437,16 +439,16 @@ public class RSEFileStoreImpl extends FileStore
children = fileServiceSubSystem.getHostFileToRemoteFileAdapter().convertToRemoteFiles(fileServiceSubSystem, context, remoteFile, results); children = fileServiceSubSystem.getHostFileToRemoteFileAdapter().convertToRemoteFiles(fileServiceSubSystem, context, remoteFile, results);
} }
else { else {
children = subSys.list(remoteFile, monitor); children = subSys.list(remoteFile, monitor);
} }
infos = new FileInfo[children.length]; infos = new FileInfo[children.length];
for (int i = 0; i < children.length; i++) for (int i = 0; i < children.length; i++)
{ {
IRemoteFile file = children[i]; IRemoteFile file = children[i];
FileInfo info = new FileInfo(file.getName()); FileInfo info = new FileInfo(file.getName());
if (!file.exists()) { if (!file.exists()) {
info.setExists(false); info.setExists(false);
} }
@ -465,16 +467,16 @@ public class RSEFileStoreImpl extends FileStore
info.setLength(file.getLength()); info.setLength(file.getLength());
} }
} }
infos[i] = info; infos[i] = info;
} }
} }
catch (SystemMessageException e) { catch (SystemMessageException e) {
//TODO check whether we should not throw an exception ourselves //TODO check whether we should not throw an exception ourselves
infos = new FileInfo[0]; infos = new FileInfo[0];
} }
} }
return infos; return infos;
} }
@ -488,7 +490,7 @@ public class RSEFileStoreImpl extends FileStore
// connect if needed. Will throw exception if not successful. // connect if needed. Will throw exception if not successful.
IRemoteFile remoteFile = getRemoteFileObject(monitor, false); IRemoteFile remoteFile = getRemoteFileObject(monitor, false);
String classification = (remoteFile==null) ? null : remoteFile.getClassification(); String classification = (remoteFile==null) ? null : remoteFile.getClassification();
FileInfo info = new FileInfo(_store.getName()); FileInfo info = new FileInfo(_store.getName());
if (remoteFile == null || !remoteFile.exists()) { if (remoteFile == null || !remoteFile.exists()) {
info.setExists(false); info.setExists(false);
@ -505,7 +507,7 @@ public class RSEFileStoreImpl extends FileStore
} }
return info; return info;
} }
info.setExists(true); info.setExists(true);
info.setLastModified(remoteFile.getLastModified()); info.setLastModified(remoteFile.getLastModified());
boolean isDir = remoteFile.isDirectory(); boolean isDir = remoteFile.isDirectory();
@ -525,12 +527,12 @@ public class RSEFileStoreImpl extends FileStore
if (!isDir) { if (!isDir) {
info.setLength(remoteFile.getLength()); info.setLength(remoteFile.getLength());
} }
return info; return info;
} }
/** /**
* Return a message for logging, built from * Return a message for logging, built from
* @param item item where failure occurred * @param item item where failure occurred
* @param e exception * @param e exception
* @return * @return
@ -551,7 +553,7 @@ public class RSEFileStoreImpl extends FileStore
} }
return exceptionText; return exceptionText;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#putInfo(org.eclipse.core.filesystem.IFileInfo, int, org.eclipse.core.runtime.IProgressMonitor) * @see org.eclipse.core.filesystem.provider.FileStore#putInfo(org.eclipse.core.filesystem.IFileInfo, int, org.eclipse.core.runtime.IProgressMonitor)
@ -585,17 +587,17 @@ public class RSEFileStoreImpl extends FileStore
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.core.filesystem.IFileStore#openInputStream(int, org.eclipse.core.runtime.IProgressMonitor) * @see org.eclipse.core.filesystem.IFileStore#openInputStream(int, org.eclipse.core.runtime.IProgressMonitor)
*/ */
public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException
{ {
IRemoteFile remoteFile = getRemoteFileObject(monitor, true); IRemoteFile remoteFile = getRemoteFileObject(monitor, true);
IRemoteFileSubSystem subSys = remoteFile.getParentRemoteFileSubSystem(); IRemoteFileSubSystem subSys = remoteFile.getParentRemoteFileSubSystem();
if (remoteFile.isDirectory()) { if (remoteFile.isDirectory()) {
throw new CoreException(new Status(IStatus.ERROR, throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(), Activator.getDefault().getBundle().getSymbolicName(),
Messages.CANNOT_OPEN_STREAM_ON_FOLDER)); Messages.CANNOT_OPEN_STREAM_ON_FOLDER));
} }
if (remoteFile.isFile()) { if (remoteFile.isFile()) {
try { try {
return subSys.getInputStream(remoteFile.getParentPath(), remoteFile.getName(), true, monitor); return subSys.getInputStream(remoteFile.getParentPath(), remoteFile.getName(), true, monitor);
@ -607,20 +609,20 @@ public class RSEFileStoreImpl extends FileStore
getExceptionMessage(null, e), e)); getExceptionMessage(null, e), e));
} }
} }
return null; return null;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.core.filesystem.IFileStore#mkdir(int, org.eclipse.core.runtime.IProgressMonitor) * @see org.eclipse.core.filesystem.IFileStore#mkdir(int, org.eclipse.core.runtime.IProgressMonitor)
*/ */
public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException
{ {
cacheRemoteFile(null); cacheRemoteFile(null);
IRemoteFile remoteFile = getRemoteFileObject(monitor, false); IRemoteFile remoteFile = getRemoteFileObject(monitor, false);
if (remoteFile==null) { if (remoteFile==null) {
throw new CoreException(new Status(IStatus.ERROR, throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(), Activator.getDefault().getBundle().getSymbolicName(),
Messages.COULD_NOT_GET_REMOTE_FILE)); Messages.COULD_NOT_GET_REMOTE_FILE));
} }
@ -632,13 +634,13 @@ public class RSEFileStoreImpl extends FileStore
} }
catch (SystemMessageException e) { catch (SystemMessageException e) {
throw new CoreException(new Status(IStatus.ERROR, throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(), Activator.getDefault().getBundle().getSymbolicName(),
getExceptionMessage(null, e), e)); getExceptionMessage(null, e), e));
} }
return _store; return _store;
} }
else if (remoteFile.isFile()) { else if (remoteFile.isFile()) {
throw new CoreException(new Status(IStatus.ERROR, throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(), Activator.getDefault().getBundle().getSymbolicName(),
Messages.FILE_NAME_EXISTS)); Messages.FILE_NAME_EXISTS));
} }
@ -669,9 +671,9 @@ public class RSEFileStoreImpl extends FileStore
throw new CoreException(new Status(IStatus.ERROR, throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(), Activator.getDefault().getBundle().getSymbolicName(),
getExceptionMessage(null, e), e)); getExceptionMessage(null, e), e));
} }
} }
if (remoteFile.isFile()) { if (remoteFile.isFile()) {
try { try {
// Convert from EFS option constants to IFileService option constants // Convert from EFS option constants to IFileService option constants
@ -698,12 +700,12 @@ public class RSEFileStoreImpl extends FileStore
return null; return null;
} }
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.core.filesystem.IFileStore#delete(int, org.eclipse.core.runtime.IProgressMonitor) * @see org.eclipse.core.filesystem.IFileStore#delete(int, org.eclipse.core.runtime.IProgressMonitor)
*/ */
public void delete(int options, IProgressMonitor monitor) throws CoreException public void delete(int options, IProgressMonitor monitor) throws CoreException
{ {
IRemoteFile remoteFile = getRemoteFileObject(monitor, false); IRemoteFile remoteFile = getRemoteFileObject(monitor, false);
IRemoteFileSubSystem subSys = remoteFile.getParentRemoteFileSubSystem(); IRemoteFileSubSystem subSys = remoteFile.getParentRemoteFileSubSystem();