I see,
I'm not sure if there is a standard way how to do this. It's certainly
possible to have custom files shipped with your module (see
http://wiki.netbeans.org/DevFaqInstalledFileLocator) but they won't be in
the user directory. The user directory is created the first time your run
gephi. However I found this page (
http://wiki.netbeans.org/DevFaqUseNativeInstaller) that seems to be able to
do something like this.
An easy way would be to create an Installer and check at startup of your
module if the files are in the user directory. If not you could copy them
from the module folder.
Mathieu
On Sat, Mar 31, 2012 at 2:51 PM, Luiz Ribeiro <
luizr...@gmail.com> wrote:
> Hi Mathieu,
>
> Sorry, I think I was not clear enough on my first question. Actually,
> I'm trying to move some files to the gephi user directory *during* the
> installation process of the plugin. Is it still possible?
>
> The reason I'm trying to do this is that I have to install a few .py
> files (jythonconsole's source more specifically, which is sitting in
> the source directory of the Scripting Plugin project) into a specific
> directory (that is on Jython's path).
>
> I could do this in other ways (like just pointing the Jython's path to
> the .jar that contains my .py files), but I think it would be nice to
> have all Python scripts into the same directory (something like
> /home/user/.gephi/0.8.1/scripts), making it easy to users extend the
> Scripting Plugin and use third-party libraries by just dropping them
> into that directory (think of Twitter/Facebook/LinkedIn Python APIs).
>
> Luiz
>
> On Sat, Mar 31, 2012 at 6:25 PM, Mathieu Bastian
> <
mathieu...@gmail.com> wrote:
> > Hi Luiz
> >
> > On Sat, Mar 31, 2012 at 2:10 PM, Luiz Ribeiro <
luizr...@gmail.com>
> wrote:
> >>
> >> Hi devs,
> >>
> >> I have a few questions that I hope some of you might be able to help me
> >> with:
> >>
> >> 1) When building a Gephi plugin, is there any way to install custom
> >> files to the Gephi user directory (i.e. /home/username/.gephi)?
> >
> >
> > Yes, it's no different than how Gephi itself do it. If you want to save
> just
> > properties and preferences use NBPreferences
> > (
>
http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/NbPreferences.html
> )
> >
> > For files you can look how we do it for preview presets (XML files):
> >
>
https://github.com/gephi/gephi/blob/master/DesktopPreview/src/org/gephi/desktop/preview/PresetUtils.java
> >
> > It essentially uses the FileUtil class provided by Netbeans Platform.
> Very
> > useful stuff.
> >
>
http://bits.netbeans.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html
> >
> >>
> >> 2) How can I get the full path to the Gephi user directory from my
> >> plugin's code?
> >
> >
> > You can get that with the 'netbeans.user' property:
> > System.getProperty("netbeans.user")
> >
> > Also checkout the InstalledFileLocator class
> >
>
http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/InstalledFileLocator.html
> >
> >>
> >>
> >> Thanks!
> >>
> >> Luiz
> >> _______________________________________________
> >> gephi-dev mailing list
> >>
geph...@lists.gephi.org
> >>
http://gephi.org/mailman/listinfo/gephi-dev
> >
> >
>