All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gephi.maven.Migrate Maven / Gradle / Ivy

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.gephi.maven;

import java.io.File;
import java.io.FileOutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;

/**
 *
 * @author mbastian
 */
public class Migrate {

    // Check if it has a nbproject folder
    // In nbproject
    // Open project.properties and collect all the names of module folders
    //    project.*= ... (example project.org.gephi.desktop.streaming=DesktopStreaming)
    // For each module found
    //   Check if it has a nbproject folder
    //   Open nbproject
    //     Open project.xml with XML reader
    //       Find and collect dependencies (some might be other modules, some might be netbeans or gephi)
    //   Check if it has manifest.mf
    //     Open manifest.mf
    //       Copy 
    // Create modules folder
    public static void main(String[] args) {
        try {
            URLConnection connection = new URL("https://gephi.org/gephi-plugins/plugins/plugins.json").openConnection();
            connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11");
            connection.connect();
            ReadableByteChannel rbc = Channels.newChannel(connection.getInputStream());
            
            File pluginsJsonFile = new File("foo.json");
            FileOutputStream fos = new FileOutputStream(pluginsJsonFile);
            long read = fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
            System.out.println(read);
        } catch (Exception ex) {
           ex.printStackTrace();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy