tag:blogger.com,1999:blog-8878360187292205236.post288296161749789144..comments2023-08-15T14:32:32.337+02:00Comments on @eclipsophy: Proper handling of linked resourcesMaarten Meijerhttp://www.blogger.com/profile/05900699818398561644noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-8878360187292205236.post-74764503862328505852010-01-16T06:31:22.452+01:002010-01-16T06:31:22.452+01:00Oh, it's something, huh?
Because of this I h...Oh, it's something, huh?<br /><br />Because of this I have a coding policy, which I enforce strictly on my team, no exceptions: any variables, or parameters that accept an IPath must contain a suffix of Path or Location. In that way, it becomes unambiguous that you expect an on-disk location or a path inside the workspace.<br /><br />Clearly 'location' vs. 'path' doesn't clarify the difference between 'workspace' and 'on-disk resource', they could have been the "path to an on-disk resource" and "location in the workspace", but no mind: the important thing is that a good naming standard sometimes matters a great deal.<br /><br />Because of that I think you're missing something by even trying to use getFullPath() to identify the on-disk resource. Maybe not, if you know there are no linked resources. Maybe since my workspaces always have linked resources, the distinction is more obvious -- I never use the *Path methods when I really want something on the local disk.konberghttps://www.blogger.com/profile/04616226121996611123noreply@blogger.comtag:blogger.com,1999:blog-8878360187292205236.post-75287397321894439132009-12-17T16:16:49.827+01:002009-12-17T16:16:49.827+01:00@Tom Seidel: thank you for your comments about cap...@Tom Seidel: thank you for your comments about capabilities of external filesystems. I tried with both f.getLocation().toFile() and f.getContents() connected to a remote UNIX system using SSH. Both worked, so I have to dig deeper.Maarten Meijerhttps://www.blogger.com/profile/05900699818398561644noreply@blogger.comtag:blogger.com,1999:blog-8878360187292205236.post-65614946531652914872009-12-17T14:02:46.146+01:002009-12-17T14:02:46.146+01:00I'm not sure if #toFile() is a better attempt....I'm not sure if #toFile() is a better attempt. You never know if the underlying efs-implementation can handle this (i guess in 99% you'll end up with an eror when browsing through alternative filesystems). I think IFile#getContents() is the best attempt.Tom Seidelhttps://www.blogger.com/profile/13994704031745066504noreply@blogger.com