[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ptp-dev] Questions about remote support
|
On Oct 8, 2007, at 4:05 PM, Dave Wootton wrote:
Greg
I just updated from head a few minutes ago and now I'm getting a null
pointer exception (see bottom of this email) when I try to create a
new
resource manager. This happens when I open the resource manager
wizard,
click PE from the list and click next. This worked correctly this
morning.
If I updated while you were in the middle of commits, that's fine,
just
let me know to try again later.
Can you check the error log to see if there is any message like
'Failed to instantiate factory...'? Also, make sure you updated the
org.eclipse.ptp.remote.rse plugin as well.
Also, the way my parallel tab works, I have a text entry field with a
ModifyListener registered, and an accompanying Text field that gets
filled
in with a path name. This gets filled in either by the user typing
in a
path name or by my code as a result of the user selecting a file
from the
file selector, in which case I get the IPath object returned by
calling
browseFile, call toString() on that object and then fill in the
text field
with that value.
I don't attempt to validate the pathname until the ModifyListener
registered on the text field gets called, which occurs either when the
user types in the field or when my code fills in the field using the
pathname obtained from the IPath object. If the user has typed in a
field,
I don't see any way to validate that pathname, since I only know the
pathname and the remote connection at that point (I don't have an
IPath
object). If I do have an IPath object, because the user clicked the
browse button, then is the intent I call getResource() to get the
associated IRemoteResource, then validate using that object?
Yes. I'd like to see if we can use IPath objects rather than Strings
as you get an extra level of validation. You can do something like this:
IPath path = new Path(textfield);
if (!path.isValidPath()) {
// invalid
}
IRemoteResource res = fileMgr.getResource(path, monitor);
if (!res.fetchInfo().exists()) {
// invalid
}
Let me know if that seems ok.
Greg