[gephi-dev] Twitter importer update and some questions

Mathieu Bastian mathieu.bastian at gmail.com
Fri Jan 7 17:26:23 CET 2011


Netbeans has a better way than Installer do do this, implement a
LifecycleManager:

@ServiceProvider(service = LifecycleManager.class, position = 10)
public class CustomNetBeansLifecycleManager extends LifecycleManager {

    @Override
    public void saveAll() {
    }

    @Override
    public void exit() {

   }
}

Netbeans has also a good way to access the user directory, which is
probably the best way to cache date. Following example for how we do
it for layout preset files (DesktopLayout):

import org.openide.filesystems.FileUtil;
...

//Create file if dont exist
FileObject folder = FileUtil.getConfigFile("layoutpresets");
if (folder == null) {
   folder = FileUtil.getConfigRoot().createFolder("layoutpresets");
 }
 FileObject presetFile = folder.getFileObject(name, "xml");
 if (presetFile == null) {
   presetFile = folder.createData(name, "xml");
}

Mathieu

On Thu, Jan 6, 2011 at 1:25 AM, Yi Du(§ù¤@) <duyi001 at gmail.com> wrote:
> Hi all,
>   I found twitter shut off all basic authentication on the Twitter API, so
> we cann't access twitter data by user name and password.  I'm migrating our
> plugin to OAuth.
>  If I use OAuth to access twitter, I have to save some authentication data
> during the lifecycle of Gephi and delete it when Gephi exit. I operated the
> authentication data using NbPreferences, and it works.
>   But what should I do if I want to do something(such as delete some caching
> data) when Gephi exit? It seems changing Installer.java and override exit()
> can do such work, but should I do this way? Do you have some other
> ideas?  Which path/location should I put the caching data if I want to do
> this?
> --
> §ù¤@ Yi Du (Yestin)
> IEL, Chinese Academy of Sciences, Institute of Software.
> TEL: +86-15810134970
> email&gtalk: duyi001 at gmail.com
>
> _______________________________________________
> gephi-dev mailing list
> gephi-dev at lists.gephi.org
> http://gephi.org/mailman/listinfo/gephi-dev
>
>


More information about the gephi-dev mailing list