// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/json/ObjectMapperProvider.java
// public class ObjectMapperProvider {
//     public static ObjectMapper newObjectMapper () {
//         ObjectMapper m = new ObjectMapper();
//         m.configure( JsonParser.Feature.ALLOW_COMMENTS, true );
//         m.configure( DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true );
//         m.configure( SerializationFeature.INDENT_OUTPUT, true );
//         m.configure( SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true );
//         m.configure( SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS, true );
//         m.configure( JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true );
//         m.configure( JsonParser.Feature.AUTO_CLOSE_SOURCE, true );
//         return m;
//     }
// 
//     public static final TypeReference<Map<String,Object>> STRING_OBJECT_MAP
//             = new TR();
// 
//     private static final class TR extends TypeReference<Map<String,Object>> {
//     }
// }
// 
// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/json/ObjectMapperProvider.java
// public static final TypeReference<Map<String,Object>> STRING_OBJECT_MAP
//         = new TR();
// 
// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/platform/NativeNodeJS.java
// public final class NativeNodeJS extends NodeJSExecutable {
//     private final String name;
// 
//     private final String sourceLocation;
//     private final String binaryLocation;
//     private final Set<Future<Integer>> futures = new WeakSet<>();
//     private final String displayName;
//     private final String version;
// 
//     public NativeNodeJS ( String name, String sourceLocation, String binaryLocation, String displayName, String version ) {
//         this.name = name;
//         this.sourceLocation = sourceLocation;
//         this.binaryLocation = binaryLocation;
//         this.displayName = displayName;
//         this.version = version;
//     }
// 
//     public String version () {
//         return version;
//     }
// 
//     public String displayName () {
//         return displayName == null ? name() : displayName;
//     }
// 
//     public String toString () {
//         return name + " in " + sourceLocation;
//     }
// 
//     @Override
//     public String name () {
//         return name;
//     }
// 
//     public String path () {
//         return binaryLocation == null ? "" : binaryLocation;
//     }
// 
//     @Override
//     public boolean isValid () {
//         return new File( binaryLocation ).exists();
//     }
// 
//     private final LaunchSupport ls = new LaunchSupport( this ) {
//         @Override
//         protected String[] getLaunchCommandLine ( boolean showDialog, Map<String, String> env ) {
//             return new String[]{binaryLocation};
//         }
//     };
// 
//     @Override
//     protected Future<Integer> doRun ( final FileObject file, String args ) throws IOException {
//         return ls.doRun( file, args );
//     }
// 
//     @Override
//     public String getSourcesLocation () {
//         return sourceLocation;
//     }
// 
//     @Override
//     public void stopRunningProcesses ( Lookup.Provider owner ) {
//         ls.stopRunningProcesses( owner );
//     }
// 
// }


import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle.Messages;
import org.openide.util.RequestProcessor;
import java.awt.EventQueue;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import javax.swing.JPanel;
import org.netbeans.modules.nodejs.json.ObjectMapperProvider;
import static org.netbeans.modules.nodejs.json.ObjectMapperProvider.STRING_OBJECT_MAP;
import org.netbeans.modules.nodejs.platform.NativeNodeJS;
            if (message != null) {
                jTextArea1.setText( message );
            }
            jProgressBar1.setIndeterminate( !ok );
            jProgressBar1.setVisible( !ok );
        }
    }

    private int ct = 1;
    private volatile String message;
    
    private volatile Map<String,Object> loaded;
    
    public Map<String,Object> data() {
        return loaded;
    }

    private void validate ( File f ) {
        try {
            File tmp = new File( System.getProperty( "java.io.tmpdir" ) ); //NOI18N
            int id = ct++;
            File probeFile = new File( tmp, System.currentTimeMillis() + "-" + id + "-probe.js" ); //NOI18N
            probeFile.createNewFile();
            File outFile = new File( tmp, System.currentTimeMillis() + "-" + id + "-nodeplatform.json" ); //NOI18N

            try (FileOutputStream out = new FileOutputStream( probeFile )) {
                try (InputStream in = ValidateNativeNodeVisualPanel.class.getResourceAsStream( "probe.js" )) { //NOI18N
                    FileUtil.copy( in, out );
                }
            }
// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/json/ObjectMapperProvider.java
// public class ObjectMapperProvider {
//     public static ObjectMapper newObjectMapper () {
//         ObjectMapper m = new ObjectMapper();
//         m.configure( JsonParser.Feature.ALLOW_COMMENTS, true );
//         m.configure( DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true );
//         m.configure( SerializationFeature.INDENT_OUTPUT, true );
//         m.configure( SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true );
//         m.configure( SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS, true );
//         m.configure( JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true );
//         m.configure( JsonParser.Feature.AUTO_CLOSE_SOURCE, true );
//         return m;
//     }
// 
//     public static final TypeReference<Map<String,Object>> STRING_OBJECT_MAP
//             = new TR();
// 
//     private static final class TR extends TypeReference<Map<String,Object>> {
//     }
// }
// 
// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/json/ObjectMapperProvider.java
// public static final TypeReference<Map<String,Object>> STRING_OBJECT_MAP
//         = new TR();
// 
// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/platform/NativeNodeJS.java
// public final class NativeNodeJS extends NodeJSExecutable {
//     private final String name;
// 
//     private final String sourceLocation;
//     private final String binaryLocation;
//     private final Set<Future<Integer>> futures = new WeakSet<>();
//     private final String displayName;
//     private final String version;
// 
//     public NativeNodeJS ( String name, String sourceLocation, String binaryLocation, String displayName, String version ) {
//         this.name = name;
//         this.sourceLocation = sourceLocation;
//         this.binaryLocation = binaryLocation;
//         this.displayName = displayName;
//         this.version = version;
//     }
// 
//     public String version () {
//         return version;
//     }
// 
//     public String displayName () {
//         return displayName == null ? name() : displayName;
//     }
// 
//     public String toString () {
//         return name + " in " + sourceLocation;
//     }
// 
//     @Override
//     public String name () {
//         return name;
//     }
// 
//     public String path () {
//         return binaryLocation == null ? "" : binaryLocation;
//     }
// 
//     @Override
//     public boolean isValid () {
//         return new File( binaryLocation ).exists();
//     }
// 
//     private final LaunchSupport ls = new LaunchSupport( this ) {
//         @Override
//         protected String[] getLaunchCommandLine ( boolean showDialog, Map<String, String> env ) {
//             return new String[]{binaryLocation};
//         }
//     };
// 
//     @Override
//     protected Future<Integer> doRun ( final FileObject file, String args ) throws IOException {
//         return ls.doRun( file, args );
//     }
// 
//     @Override
//     public String getSourcesLocation () {
//         return sourceLocation;
//     }
// 
//     @Override
//     public void stopRunningProcesses ( Lookup.Provider owner ) {
//         ls.stopRunningProcesses( owner );
//     }
// 
// }


// Path: node-projects/src/main/java/org/netbeans/modules/nodejs/platform/wizard/ValidateNativeNodeVisualPanel.java
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle.Messages;
import org.openide.util.RequestProcessor;
import java.awt.EventQueue;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import javax.swing.JPanel;
import org.netbeans.modules.nodejs.json.ObjectMapperProvider;
import static org.netbeans.modules.nodejs.json.ObjectMapperProvider.STRING_OBJECT_MAP;
import org.netbeans.modules.nodejs.platform.NativeNodeJS;

            if (message != null) {
                jTextArea1.setText( message );
            }
            jProgressBar1.setIndeterminate( !ok );
            jProgressBar1.setVisible( !ok );
        }
    }

    private int ct = 1;
    private volatile String message;
    
    private volatile Map<String,Object> loaded;
    
    public Map<String,Object> data() {
        return loaded;
    }

    private void validate ( File f ) {
        try {
            File tmp = new File( System.getProperty( "java.io.tmpdir" ) ); //NOI18N
            int id = ct++;
            File probeFile = new File( tmp, System.currentTimeMillis() + "-" + id + "-probe.js" ); //NOI18N
            probeFile.createNewFile();
            File outFile = new File( tmp, System.currentTimeMillis() + "-" + id + "-nodeplatform.json" ); //NOI18N

            try (FileOutputStream out = new FileOutputStream( probeFile )) {
                try (InputStream in = ValidateNativeNodeVisualPanel.class.getResourceAsStream( "probe.js" )) { //NOI18N
                    FileUtil.copy( in, out );
                }
            }
            NativeNodeJS test = new NativeNodeJS( "test", null, f.getAbsolutePath(), "Test", "x" );