You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by po...@apache.org on 2017/09/03 17:33:01 UTC
[08/51] [partial] incubator-netbeans-jackpot30 git commit:
INFRA-15006 Import for http://bits.netbeans.org/download/apache-donation
http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/remoting/server/web/nbindex.web.api/nbproject/project.properties
----------------------------------------------------------------------
diff --git a/remoting/server/web/nbindex.web.api/nbproject/project.properties b/remoting/server/web/nbindex.web.api/nbproject/project.properties
new file mode 100644
index 0000000..2af2976
--- /dev/null
+++ b/remoting/server/web/nbindex.web.api/nbproject/project.properties
@@ -0,0 +1,129 @@
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved.
+#
+# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+# Other names may be trademarks of their respective owners.
+#
+# The contents of this file are subject to the terms of either the GNU
+# General Public License Version 2 only ("GPL") or the Common
+# Development and Distribution License("CDDL") (collectively, the
+# "License"). You may not use this file except in compliance with the
+# License. You can obtain a copy of the License at
+# http://www.netbeans.org/cddl-gplv2.html
+# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+# specific language governing permissions and limitations under the
+# License. When distributing the software, include this License Header
+# Notice in each file and include the License file at
+# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the GPL Version 2 section of the License file that
+# accompanied this code. If applicable, add the following below the
+# License Header, with the fields enclosed by brackets [] replaced by
+# your own identifying information:
+# "Portions Copyrighted [year] [name of copyright owner]"
+#
+# Contributor(s):
+#
+# The Original Software is NetBeans. The Initial Developer of the Original
+# Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun
+# Microsystems, Inc. All Rights Reserved.
+#
+# If you wish your version of this file to be governed by only the CDDL
+# or only the GPL Version 2, indicate your decision by adding
+# "[Contributor] elects to include this software in this distribution
+# under the [CDDL or GPL Version 2] license." If you do not indicate a
+# single choice of license, a recipient has the option to distribute
+# your version of this file under either the CDDL, the GPL Version 2 or
+# to extend the choice of license to its licensees as provided above.
+# However, if you add GPL Version 2 code and therefore, elected the GPL
+# Version 2 license, then the option applies only if the new code is
+# made subject to such option by the copyright holder.
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processor.options=
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/nbindex.web.api.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+file.reference.org-netbeans-modules-parsing-api.jar=../../../../lib/org-netbeans-modules-parsing-api.jar
+file.reference.org-netbeans-modules-parsing-lucene.jar=../../../../lib/org-netbeans-modules-parsing-lucene.jar
+file.reference.org-openide-filesystems.jar=../../../../lib/org-openide-filesystems.jar
+file.reference.org-openide-util.jar=../../../../lib/org-openide-util.jar
+file.reference.util-commons.jar=../../../ide/api/external/util-commons.jar
+file.reference.util-pojson.jar=../../../ide/api/external/util-pojson.jar
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${libs.jersey.classpath}:\
+ ${libs.lucene.classpath}:\
+ ${reference.base_web_api.jar}:\
+ ${file.reference.org-netbeans-modules-parsing-api.jar}:\
+ ${file.reference.org-openide-filesystems.jar}:\
+ ${file.reference.org-netbeans-modules-parsing-lucene.jar}:\
+ ${file.reference.util-commons.jar}:\
+ ${file.reference.util-pojson.jar}:\
+ ${file.reference.org-openide-util.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.6
+javac.target=1.6
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+project.base_web_api=../base.web.api
+reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/remoting/server/web/nbindex.web.api/nbproject/project.xml
----------------------------------------------------------------------
diff --git a/remoting/server/web/nbindex.web.api/nbproject/project.xml b/remoting/server/web/nbindex.web.api/nbproject/project.xml
new file mode 100644
index 0000000..4e9c9e5
--- /dev/null
+++ b/remoting/server/web/nbindex.web.api/nbproject/project.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved.
+
+Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+Other names may be trademarks of their respective owners.
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License. When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+Contributor(s):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun
+Microsystems, Inc. All Rights Reserved.
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+-->
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.java.j2seproject</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+ <name>nbindex.web.api</name>
+ <source-roots>
+ <root id="src.dir"/>
+ </source-roots>
+ <test-roots>
+ <root id="test.src.dir"/>
+ </test-roots>
+ </data>
+ <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
+ <definitions>../../../../lib/nblibraries.properties</definitions>
+ </libraries>
+ <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
+ <reference>
+ <foreign-project>base_web_api</foreign-project>
+ <artifact-type>jar</artifact-type>
+ <script>build.xml</script>
+ <target>jar</target>
+ <clean-target>clean</clean-target>
+ <id>jar</id>
+ </reference>
+ </references>
+ </configuration>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/remoting/server/web/nbindex.web.api/src/org/netbeans/modules/jackpot30/backend/usages/api/DownloadableIndex.java
----------------------------------------------------------------------
diff --git a/remoting/server/web/nbindex.web.api/src/org/netbeans/modules/jackpot30/backend/usages/api/DownloadableIndex.java b/remoting/server/web/nbindex.web.api/src/org/netbeans/modules/jackpot30/backend/usages/api/DownloadableIndex.java
new file mode 100644
index 0000000..0c4c766
--- /dev/null
+++ b/remoting/server/web/nbindex.web.api/src/org/netbeans/modules/jackpot30/backend/usages/api/DownloadableIndex.java
@@ -0,0 +1,160 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2011 Sun Microsystems, Inc.
+ */
+package org.netbeans.modules.jackpot30.backend.usages.api;
+
+import java.io.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.jar.JarOutputStream;
+import java.util.zip.ZipEntry;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import org.netbeans.modules.jackpot30.backend.base.CategoryStorage;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.NbCollections;
+
+/**
+ *
+ * @author lahvac
+ */
+@Path("/index/downloadable")
+public class DownloadableIndex {
+
+ @GET
+ @Path("/netbeans")
+ @Produces("application/octet-stream")
+ public Response netbeans(@QueryParam("path") String segment, @QueryParam("root") String root) throws IOException, InterruptedException {
+ CategoryStorage category = CategoryStorage.forId(segment);
+ final File idx = category.getSegment(root);
+
+ if (idx == null || !idx.canRead()) return Response.status(Response.Status.NOT_FOUND).build();
+
+ return Response.ok().entity(new StreamingOutput() {
+ @Override public void write(OutputStream output) throws IOException, WebApplicationException {
+ InputStream in = new FileInputStream(idx);
+ byte[] read = new byte[8 * 1024];
+
+ while (true) {
+ int n = in.read(read);
+
+ if (n == (-1)) break;
+
+ output.write(read, 0, n);
+ }
+
+ in.close(); //TODO: finally
+ }
+ } ).build();
+ }
+
+ private static final Collection<String> PARTS_TO_COPY = Arrays.asList("index", "info", "segments");
+
+ @GET
+ @Path("/index")
+ @Produces("application/octet-stream")
+ public Response index(@QueryParam("path") String segment) throws IOException, InterruptedException {
+ CategoryStorage category = CategoryStorage.forId(segment);
+ final FileObject idxRoot = category.getCacheRoot();
+
+ if (idxRoot == null || !idxRoot.canRead()) return Response.status(Response.Status.NOT_FOUND).build();
+
+ long totalSize = 0;
+
+ for (String rel : PARTS_TO_COPY) {
+ FileObject relFO = idxRoot.getFileObject(rel);
+
+ if (relFO == null) continue;
+
+ Iterable<? extends FileObject> children;
+
+ if (relFO.isFolder()) children = NbCollections.iterable(relFO.getChildren(true));
+ else children = Collections.singletonList(relFO);
+
+ for (FileObject c : children) {
+ if (c.isFolder()) continue;
+
+ totalSize += c.getSize();
+ }
+ }
+
+ return Response.ok().header("NB-Total-Unpacked-Size", String.valueOf(totalSize)).entity(new StreamingOutput() {
+ @Override public void write(OutputStream output) throws IOException, WebApplicationException {
+ JarOutputStream out = new JarOutputStream(output);
+
+ try {
+ for (String rel : PARTS_TO_COPY) {
+ FileObject relFO = idxRoot.getFileObject(rel);
+
+ if (relFO == null) continue;
+
+ Iterable<? extends FileObject> children;
+
+ if (relFO.isFolder()) children = NbCollections.iterable(relFO.getChildren(true));
+ else children = Collections.singletonList(relFO);
+
+ for (FileObject c : children) {
+ if (c.isFolder()) continue;
+
+ out.putNextEntry(new ZipEntry(FileUtil.getRelativePath(idxRoot, c)));
+
+ InputStream in = c.getInputStream();
+
+ try {
+ FileUtil.copy(in, out);
+ } finally {
+ in.close();
+ }
+
+ out.closeEntry();
+ }
+ }
+ } finally {
+ out.close();
+ }
+ }
+ } ).build();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/remoting/server/web/resolve.web.api/build.xml
----------------------------------------------------------------------
diff --git a/remoting/server/web/resolve.web.api/build.xml b/remoting/server/web/resolve.web.api/build.xml
new file mode 100644
index 0000000..7ddcc8b
--- /dev/null
+++ b/remoting/server/web/resolve.web.api/build.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved.
+
+Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+Other names may be trademarks of their respective owners.
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License. When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+Contributor(s):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun
+Microsystems, Inc. All Rights Reserved.
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+-->
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="resolve.web.api" default="default" basedir=".">
+ <description>Builds, tests, and runs the project resolve.web.api.</description>
+ <import file="nbproject/build-impl.xml"/>
+ <!--
+
+ There exist several targets which are by default empty and which can be
+ used for execution of your tasks. These targets are usually executed
+ before and after some main targets. They are:
+
+ -pre-init: called before initialization of project properties
+ -post-init: called after initialization of project properties
+ -pre-compile: called before javac compilation
+ -post-compile: called after javac compilation
+ -pre-compile-single: called before javac compilation of single file
+ -post-compile-single: called after javac compilation of single file
+ -pre-compile-test: called before javac compilation of JUnit tests
+ -post-compile-test: called after javac compilation of JUnit tests
+ -pre-compile-test-single: called before javac compilation of single JUnit test
+ -post-compile-test-single: called after javac compilation of single JUunit test
+ -pre-jar: called before JAR building
+ -post-jar: called after JAR building
+ -post-clean: called after cleaning build products
+
+ (Targets beginning with '-' are not intended to be called on their own.)
+
+ Example of inserting an obfuscator after compilation could look like this:
+
+ <target name="-post-compile">
+ <obfuscate>
+ <fileset dir="${build.classes.dir}"/>
+ </obfuscate>
+ </target>
+
+ For list of available properties check the imported
+ nbproject/build-impl.xml file.
+
+
+ Another way to customize the build is by overriding existing main targets.
+ The targets of interest are:
+
+ -init-macrodef-javac: defines macro for javac compilation
+ -init-macrodef-junit: defines macro for junit execution
+ -init-macrodef-debug: defines macro for class debugging
+ -init-macrodef-java: defines macro for class execution
+ -do-jar: JAR building
+ run: execution of project
+ -javadoc-build: Javadoc generation
+ test-report: JUnit report generation
+
+ An example of overriding the target for project execution could look like this:
+
+ <target name="run" depends="resolve.web.api-impl.jar">
+ <exec dir="bin" executable="launcher.exe">
+ <arg file="${dist.jar}"/>
+ </exec>
+ </target>
+
+ Notice that the overridden target depends on the jar target and not only on
+ the compile target as the regular run target does. Again, for a list of available
+ properties which you can use, check the target you are overriding in the
+ nbproject/build-impl.xml file.
+
+ -->
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/remoting/server/web/resolve.web.api/manifest.mf
----------------------------------------------------------------------
diff --git a/remoting/server/web/resolve.web.api/manifest.mf b/remoting/server/web/resolve.web.api/manifest.mf
new file mode 100644
index 0000000..328e8e5
--- /dev/null
+++ b/remoting/server/web/resolve.web.api/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+