Refactored using IntelliJ
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -112,7 +112,7 @@
|
||||
<dependency>
|
||||
<groupId>org.openautonomousconnection</groupId>
|
||||
<artifactId>Protocol</artifactId>
|
||||
<version>1.0.0-BETA.7.3</version>
|
||||
<version>1.0.0-BETA.7.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.openautonomousconnection.webserver;
|
||||
|
||||
import jdk.dynalink.linker.LinkerServices;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public final class ContentTypeResolver {
|
||||
|
||||
@@ -17,7 +17,8 @@ import java.util.Scanner;
|
||||
|
||||
public class Main {
|
||||
public static final CommandPermission PERMISSION_ALL = new CommandPermission("all", 1);
|
||||
private static final CommandExecutor commandExecutor = new CommandExecutor("WebServer", PERMISSION_ALL) {};
|
||||
private static final CommandExecutor commandExecutor = new CommandExecutor("WebServer", PERMISSION_ALL) {
|
||||
};
|
||||
|
||||
@Getter
|
||||
private static CommandManager commandManager;
|
||||
|
||||
@@ -18,7 +18,8 @@ import org.openautonomousconnection.webserver.utils.WebHasher;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
@ProtocolInfo(protocolSide = ProtocolVersion.ProtocolSide.WEB)
|
||||
public final class WebServer extends ProtocolWebServer {
|
||||
@@ -80,8 +81,10 @@ public final class WebServer extends ProtocolWebServer {
|
||||
File root = getContentFolder().getCanonicalFile();
|
||||
File file = new File(root, path).getCanonicalFile();
|
||||
|
||||
if (!file.getPath().startsWith(root.getPath())) return new WebResponsePacket(403, "text/plain; charset=utf-8", Map.of(), "Forbidden".getBytes());
|
||||
if (!file.exists() || !file.isFile()) return new WebResponsePacket(404, "text/plain; charset=utf-8", Map.of(), "Not found".getBytes());
|
||||
if (!file.getPath().startsWith(root.getPath()))
|
||||
return new WebResponsePacket(403, "text/plain; charset=utf-8", Map.of(), "Forbidden".getBytes());
|
||||
if (!file.exists() || !file.isFile())
|
||||
return new WebResponsePacket(404, "text/plain; charset=utf-8", Map.of(), "Not found".getBytes());
|
||||
|
||||
String contentType = ContentTypeResolver.resolve(file.getName());
|
||||
long size = file.length();
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package org.openautonomousconnection.webserver.api;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Declares a route path for a server-side Java WebPage.
|
||||
|
||||
@@ -41,7 +41,15 @@ public final class SessionContext {
|
||||
return new SessionContext(sessionId, user, true);
|
||||
}
|
||||
|
||||
public boolean isValid() { return valid; }
|
||||
public String getSessionId() { return sessionId; }
|
||||
public String getUser() { return user; }
|
||||
public boolean isValid() {
|
||||
return valid;
|
||||
}
|
||||
|
||||
public String getSessionId() {
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package org.openautonomousconnection.webserver.api;
|
||||
import org.openautonomousconnection.protocol.packets.v1_0_0.beta.web.WebRequestPacket;
|
||||
import org.openautonomousconnection.protocol.side.server.CustomConnectedClient;
|
||||
import org.openautonomousconnection.protocol.side.web.ProtocolWebServer;
|
||||
import org.openautonomousconnection.webserver.utils.WebHasher;
|
||||
import org.openautonomousconnection.webserver.utils.RequestParams;
|
||||
import org.openautonomousconnection.webserver.utils.WebHasher;
|
||||
|
||||
/**
|
||||
* Context passed to Java WebPages (client, request, session, params, hasher).
|
||||
|
||||
@@ -8,16 +8,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
*/
|
||||
public final class JavaPageCache {
|
||||
|
||||
private static final class Entry {
|
||||
final long lastModified;
|
||||
final Class<?> clazz;
|
||||
|
||||
Entry(long lastModified, Class<?> clazz) {
|
||||
this.lastModified = lastModified;
|
||||
this.clazz = clazz;
|
||||
}
|
||||
}
|
||||
|
||||
private final ConcurrentHashMap<String, Entry> cache = new ConcurrentHashMap<>();
|
||||
|
||||
public Class<?> getOrCompile(File javaFile) throws Exception {
|
||||
@@ -33,4 +23,7 @@ public final class JavaPageCache {
|
||||
cache.put(key, new Entry(lm, compiled));
|
||||
return compiled;
|
||||
}
|
||||
|
||||
private record Entry(long lastModified, Class<?> clazz) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package org.openautonomousconnection.webserver.runtime;
|
||||
|
||||
import javax.tools.*;
|
||||
import javax.tools.JavaCompiler;
|
||||
import javax.tools.JavaFileObject;
|
||||
import javax.tools.StandardJavaFileManager;
|
||||
import javax.tools.ToolProvider;
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
@@ -16,7 +19,8 @@ import java.util.List;
|
||||
*/
|
||||
public final class JavaPageCompiler {
|
||||
|
||||
private JavaPageCompiler() {}
|
||||
private JavaPageCompiler() {
|
||||
}
|
||||
|
||||
public static Class<?> compile(File javaFile) throws Exception {
|
||||
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
||||
|
||||
@@ -7,8 +7,8 @@ import org.openautonomousconnection.protocol.side.web.ProtocolWebServer;
|
||||
import org.openautonomousconnection.webserver.WebServer;
|
||||
import org.openautonomousconnection.webserver.api.WebPage;
|
||||
import org.openautonomousconnection.webserver.api.WebPageContext;
|
||||
import org.openautonomousconnection.webserver.utils.WebHasher;
|
||||
import org.openautonomousconnection.webserver.utils.RequestParams;
|
||||
import org.openautonomousconnection.webserver.utils.WebHasher;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -21,7 +21,8 @@ public final class JavaPageDispatcher {
|
||||
|
||||
private static final JavaRouteRegistry ROUTES = new JavaRouteRegistry();
|
||||
|
||||
private JavaPageDispatcher() {}
|
||||
private JavaPageDispatcher() {
|
||||
}
|
||||
|
||||
public static WebResponsePacket dispatch(
|
||||
CustomConnectedClient client,
|
||||
|
||||
@@ -4,7 +4,10 @@ import org.openautonomousconnection.webserver.api.Route;
|
||||
import org.openautonomousconnection.webserver.api.WebPage;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
@@ -18,24 +21,50 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
*/
|
||||
public final class JavaRouteRegistry {
|
||||
|
||||
private static final class RouteEntry {
|
||||
final File sourceFile;
|
||||
final long lastModified;
|
||||
final String fqcn;
|
||||
final boolean routable;
|
||||
|
||||
RouteEntry(File sourceFile, long lastModified, String fqcn, boolean routable) {
|
||||
this.sourceFile = sourceFile;
|
||||
this.lastModified = lastModified;
|
||||
this.fqcn = fqcn;
|
||||
this.routable = routable;
|
||||
}
|
||||
}
|
||||
|
||||
private final JavaPageCache cache = new JavaPageCache();
|
||||
private final ConcurrentHashMap<String, RouteEntry> routes = new ConcurrentHashMap<>();
|
||||
private final ConcurrentHashMap<String, Long> scanState = new ConcurrentHashMap<>();
|
||||
|
||||
private static String normalizeRoute(String value) {
|
||||
if (value == null) return "/";
|
||||
String v = value.trim();
|
||||
if (v.isEmpty()) return "/";
|
||||
if (!v.startsWith("/")) v = "/" + v;
|
||||
return v;
|
||||
}
|
||||
|
||||
private static List<File> listJavaFiles(File root) {
|
||||
ArrayList<File> out = new ArrayList<>();
|
||||
Deque<File> stack = new ArrayDeque<>();
|
||||
stack.push(root);
|
||||
|
||||
while (!stack.isEmpty()) {
|
||||
File cur = stack.pop();
|
||||
File[] children = cur.listFiles();
|
||||
if (children == null) continue;
|
||||
|
||||
for (File c : children) {
|
||||
if (c.isDirectory()) {
|
||||
stack.push(c);
|
||||
} else if (c.isFile() && c.getName().endsWith(".java")) {
|
||||
out.add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
private static long folderLastModified(File folder) {
|
||||
long lm = folder.lastModified();
|
||||
File[] children = folder.listFiles();
|
||||
if (children == null) return lm;
|
||||
for (File c : children) {
|
||||
lm = Math.max(lm, c.isDirectory() ? folderLastModified(c) : c.lastModified());
|
||||
}
|
||||
return lm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refreshes registry when content folder changed.
|
||||
*
|
||||
@@ -88,44 +117,7 @@ public final class JavaRouteRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
private static String normalizeRoute(String value) {
|
||||
if (value == null) return "/";
|
||||
String v = value.trim();
|
||||
if (v.isEmpty()) return "/";
|
||||
if (!v.startsWith("/")) v = "/" + v;
|
||||
return v;
|
||||
}
|
||||
|
||||
private static List<File> listJavaFiles(File root) {
|
||||
ArrayList<File> out = new ArrayList<>();
|
||||
Deque<File> stack = new ArrayDeque<>();
|
||||
stack.push(root);
|
||||
|
||||
while (!stack.isEmpty()) {
|
||||
File cur = stack.pop();
|
||||
File[] children = cur.listFiles();
|
||||
if (children == null) continue;
|
||||
|
||||
for (File c : children) {
|
||||
if (c.isDirectory()) {
|
||||
stack.push(c);
|
||||
} else if (c.isFile() && c.getName().endsWith(".java")) {
|
||||
out.add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
private static long folderLastModified(File folder) {
|
||||
long lm = folder.lastModified();
|
||||
File[] children = folder.listFiles();
|
||||
if (children == null) return lm;
|
||||
for (File c : children) {
|
||||
lm = Math.max(lm, c.isDirectory() ? folderLastModified(c) : c.lastModified());
|
||||
}
|
||||
return lm;
|
||||
private record RouteEntry(File sourceFile, long lastModified, String fqcn, boolean routable) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,5 +127,6 @@ public final class JavaRouteRegistry {
|
||||
* @param fqcn fully qualified class name
|
||||
* @param routable true if @Route + implements WebPage
|
||||
*/
|
||||
public record RouteLookupResult(File sourceFile, String fqcn, boolean routable) {}
|
||||
public record RouteLookupResult(File sourceFile, String fqcn, boolean routable) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ import java.nio.charset.StandardCharsets;
|
||||
*/
|
||||
public final class Html {
|
||||
|
||||
private Html() {}
|
||||
private Html() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes text for HTML.
|
||||
|
||||
@@ -38,6 +38,35 @@ public final class WebHasher {
|
||||
this.pbkdf2KeyBytes = pbkdf2KeyBytes;
|
||||
}
|
||||
|
||||
private static byte[] derive(char[] password, byte[] salt, int iterations, int keyBytes) {
|
||||
try {
|
||||
PBEKeySpec spec = new PBEKeySpec(password, salt, iterations, keyBytes * 8);
|
||||
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
|
||||
return skf.generateSecret(spec).getEncoded();
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("PBKDF2 not available", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean constantTimeEquals(byte[] a, byte[] b) {
|
||||
if (a == null || b == null) return false;
|
||||
if (a.length != b.length) return false;
|
||||
int r = 0;
|
||||
for (int i = 0; i < a.length; i++) r |= (a[i] ^ b[i]);
|
||||
return r == 0;
|
||||
}
|
||||
|
||||
private static String toHexLower(byte[] data) {
|
||||
final char[] hex = "0123456789abcdef".toCharArray();
|
||||
char[] out = new char[data.length * 2];
|
||||
int i = 0;
|
||||
for (byte b : data) {
|
||||
out[i++] = hex[(b >>> 4) & 0x0F];
|
||||
out[i++] = hex[b & 0x0F];
|
||||
}
|
||||
return new String(out);
|
||||
}
|
||||
|
||||
/**
|
||||
* SHA-256 hashes text (lowercase hex).
|
||||
*
|
||||
@@ -107,33 +136,4 @@ public final class WebHasher {
|
||||
byte[] actual = derive(password.toCharArray(), salt, it, expected.length);
|
||||
return constantTimeEquals(expected, actual);
|
||||
}
|
||||
|
||||
private static byte[] derive(char[] password, byte[] salt, int iterations, int keyBytes) {
|
||||
try {
|
||||
PBEKeySpec spec = new PBEKeySpec(password, salt, iterations, keyBytes * 8);
|
||||
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
|
||||
return skf.generateSecret(spec).getEncoded();
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("PBKDF2 not available", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean constantTimeEquals(byte[] a, byte[] b) {
|
||||
if (a == null || b == null) return false;
|
||||
if (a.length != b.length) return false;
|
||||
int r = 0;
|
||||
for (int i = 0; i < a.length; i++) r |= (a[i] ^ b[i]);
|
||||
return r == 0;
|
||||
}
|
||||
|
||||
private static String toHexLower(byte[] data) {
|
||||
final char[] hex = "0123456789abcdef".toCharArray();
|
||||
char[] out = new char[data.length * 2];
|
||||
int i = 0;
|
||||
for (byte b : data) {
|
||||
out[i++] = hex[(b >>> 4) & 0x0F];
|
||||
out[i++] = hex[b & 0x0F];
|
||||
}
|
||||
return new String(out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Javassist License</TITLE>
|
||||
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
|
||||
<META content="MSHTML 5.50.4916.2300" name=GENERATOR></HEAD>
|
||||
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
|
||||
<META content="MSHTML 5.50.4916.2300" name=GENERATOR>
|
||||
</HEAD>
|
||||
|
||||
<BODY text=#000000 vLink=#551a8b aLink=#ff0000 link=#0000ee bgColor=#ffffff>
|
||||
<BODY aLink=#ff0000 bgColor=#ffffff link=#0000ee text=#000000 vLink=#551a8b>
|
||||
<CENTER><B><FONT size=+2>MOZILLA PUBLIC LICENSE</FONT></B> <BR><B>Version
|
||||
1.1</B>
|
||||
<P>
|
||||
@@ -42,7 +43,8 @@
|
||||
<UL><B>A.</B> Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
<P><B>B.</B> Any new file that contains any part of the Original Code or
|
||||
previous Modifications. <BR> </P></UL><B>1.10. ''Original Code''</B>
|
||||
previous Modifications. <BR> </P></UL>
|
||||
<B>1.10. ''Original Code''</B>
|
||||
means Source Code of computer software code which is described in the Source
|
||||
Code notice required by <B>Exhibit A</B> as Original Code, and which, at the
|
||||
time of its release under this License is not already Covered Code governed by
|
||||
@@ -66,7 +68,8 @@
|
||||
means (a) the power, direct or indirect, to cause the direction or management
|
||||
of such entity, whether by contract or otherwise, or (b) ownership of more
|
||||
than fifty percent (50%) of the outstanding shares or beneficial ownership of
|
||||
such entity.</P></UL><B>2. Source Code License.</B>
|
||||
such entity.</P></UL>
|
||||
<B>2. Source Code License.</B>
|
||||
<UL><B>2.1. The Initial Developer Grant.</B> <BR>The Initial Developer hereby
|
||||
grants You a world-wide, royalty-free, non-exclusive license, subject to third
|
||||
party intellectual property claims:
|
||||
@@ -79,14 +82,17 @@
|
||||
of Original Code, to make, have made, use, practice, sell, and offer for
|
||||
sale, and/or otherwise dispose of the Original Code (or portions thereof).
|
||||
<UL>
|
||||
<UL></UL></UL><B>(c) </B>the licenses granted in this Section 2.1(a) and (b)
|
||||
<UL></UL>
|
||||
</UL>
|
||||
<B>(c) </B>the licenses granted in this Section 2.1(a) and (b)
|
||||
are effective on the date Initial Developer first distributes Original Code
|
||||
under the terms of this License.
|
||||
<P><B>(d) </B>Notwithstanding Section 2.1(b) above, no patent license is
|
||||
granted: 1) for code that You delete from the Original Code; 2) separate
|
||||
from the Original Code; or 3) for infringements caused by: i) the
|
||||
modification of the Original Code or ii) the combination of the Original
|
||||
Code with other software or devices. <BR> </P></UL><B>2.2. Contributor
|
||||
Code with other software or devices. <BR> </P></UL>
|
||||
<B>2.2. Contributor
|
||||
Grant.</B> <BR>Subject to third party intellectual property claims, each
|
||||
Contributor hereby grants You a world-wide, royalty-free, non-exclusive
|
||||
license
|
||||
@@ -115,7 +121,8 @@
|
||||
Modifications made by that Contributor with other software (except as
|
||||
part of the Contributor Version) or other devices; or 4) under Patent Claims
|
||||
infringed by Covered Code in the absence of Modifications made by that
|
||||
Contributor.</P></UL></UL>
|
||||
Contributor.</P></UL>
|
||||
</UL>
|
||||
<P><BR><B>3. Distribution Obligations.</B>
|
||||
<UL><B>3.1. Application of License.</B> <BR>The Modifications which You create
|
||||
or to which You contribute are governed by the terms of this License,
|
||||
@@ -168,7 +175,8 @@
|
||||
<UL>Contributor represents that, except as disclosed pursuant to Section
|
||||
3.4(a) above, Contributor believes that Contributor's Modifications are
|
||||
Contributor's original creation(s) and/or Contributor has sufficient rights
|
||||
to grant the rights conveyed by this License.</UL>
|
||||
to grant the rights conveyed by this License.
|
||||
</UL>
|
||||
<P><BR><B>3.5. Required Notices.</B> <BR>You must duplicate the notice in
|
||||
<B>Exhibit A</B> in each file of the Source Code. If it is not possible
|
||||
to put such notice in a particular Source Code file due to its structure, then
|
||||
@@ -210,7 +218,8 @@
|
||||
Covered Code with other code not governed by the terms of this License and
|
||||
distribute the Larger Work as a single product. In such a case, You must make
|
||||
sure the requirements of this License are fulfilled for the Covered
|
||||
Code.</P></UL><B>4. Inability to Comply Due to Statute or Regulation.</B>
|
||||
Code.</P></UL>
|
||||
<B>4. Inability to Comply Due to Statute or Regulation.</B>
|
||||
<UL>If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to statute,
|
||||
judicial order, or regulation then You must: (a) comply with the terms of this
|
||||
@@ -219,9 +228,13 @@ Code.</P></UL><B>4. Inability to Comply Due to Statute or Regulation.</B>
|
||||
described in Section <B>3.4</B> and must be included with all distributions of
|
||||
the Source Code. Except to the extent prohibited by statute or regulation,
|
||||
such description must be sufficiently detailed for a recipient of ordinary
|
||||
skill to be able to understand it.</UL><B>5. Application of this License.</B>
|
||||
skill to be able to understand it.
|
||||
</UL>
|
||||
<B>5. Application of this License.</B>
|
||||
<UL>This License applies to code to which the Initial Developer has attached
|
||||
the notice in <B>Exhibit A</B> and to related Covered Code.</UL><B>6. Versions
|
||||
the notice in <B>Exhibit A</B> and to related Covered Code.
|
||||
</UL>
|
||||
<B>6. Versions
|
||||
of the License.</B>
|
||||
<UL><B>6.1. New Versions</B>. <BR>Netscape Communications Corporation
|
||||
(''Netscape'') may publish revised and/or new versions of the License from
|
||||
@@ -242,7 +255,8 @@ of the License.</B>
|
||||
terms which differ from the Mozilla Public License and Netscape Public
|
||||
License. (Filling in the name of the Initial Developer, Original Code or
|
||||
Contributor in the notice described in <B>Exhibit A</B> shall not of
|
||||
themselves be deemed to be modifications of this License.)</P></UL><B>7.
|
||||
themselves be deemed to be modifications of this License.)</P></UL>
|
||||
<B>7.
|
||||
DISCLAIMER OF WARRANTY.</B>
|
||||
<UL>COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
|
||||
@@ -253,7 +267,9 @@ DISCLAIMER OF WARRANTY.</B>
|
||||
OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
|
||||
LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
|
||||
DISCLAIMER.</UL><B>8. TERMINATION.</B>
|
||||
DISCLAIMER.
|
||||
</UL>
|
||||
<B>8. TERMINATION.</B>
|
||||
<UL><B>8.1. </B>This License and the rights granted hereunder will
|
||||
terminate automatically if You fail to comply with terms herein and fail to
|
||||
cure such breach within 30 days of becoming aware of the breach. All
|
||||
@@ -292,7 +308,8 @@ DISCLAIMER OF WARRANTY.</B>
|
||||
<P><B>8.4.</B> In the event of termination under Sections 8.1 or 8.2
|
||||
above, all end user license agreements (excluding distributors and
|
||||
resellers) which have been validly granted by You or any distributor hereunder
|
||||
prior to termination shall survive termination.</P></UL><B>9. LIMITATION OF
|
||||
prior to termination shall survive termination.</P></UL>
|
||||
<B>9. LIMITATION OF
|
||||
LIABILITY.</B>
|
||||
<UL>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
|
||||
NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
|
||||
@@ -306,13 +323,17 @@ LIABILITY.</B>
|
||||
INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR
|
||||
LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND
|
||||
LIMITATION MAY NOT APPLY TO YOU.</UL><B>10. U.S. GOVERNMENT END USERS.</B>
|
||||
LIMITATION MAY NOT APPLY TO YOU.
|
||||
</UL>
|
||||
<B>10. U.S. GOVERNMENT END USERS.</B>
|
||||
<UL>The Covered Code is a ''commercial item,'' as that term is defined in 48
|
||||
C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and
|
||||
''commercial computer software documentation,'' as such terms are used in 48
|
||||
C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R.
|
||||
227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users
|
||||
acquire Covered Code with only those rights set forth herein.</UL><B>11.
|
||||
acquire Covered Code with only those rights set forth herein.
|
||||
</UL>
|
||||
<B>11.
|
||||
MISCELLANEOUS.</B>
|
||||
<UL>This License represents the complete agreement concerning subject matter
|
||||
hereof. If any provision of this License is held to be unenforceable, such
|
||||
@@ -329,18 +350,23 @@ MISCELLANEOUS.</B>
|
||||
Nations Convention on Contracts for the International Sale of Goods is
|
||||
expressly excluded. Any law or regulation which provides that the language of
|
||||
a contract shall be construed against the drafter shall not apply to this
|
||||
License.</UL><B>12. RESPONSIBILITY FOR CLAIMS.</B>
|
||||
License.
|
||||
</UL>
|
||||
<B>12. RESPONSIBILITY FOR CLAIMS.</B>
|
||||
<UL>As between Initial Developer and the Contributors, each party is
|
||||
responsible for claims and damages arising, directly or indirectly, out of its
|
||||
utilization of rights under this License and You agree to work with Initial
|
||||
Developer and Contributors to distribute such responsibility on an equitable
|
||||
basis. Nothing herein is intended or shall be deemed to constitute any
|
||||
admission of liability.</UL><B>13. MULTIPLE-LICENSED CODE.</B>
|
||||
admission of liability.
|
||||
</UL>
|
||||
<B>13. MULTIPLE-LICENSED CODE.</B>
|
||||
<UL>Initial Developer may designate portions of the Covered Code as
|
||||
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
|
||||
Developer permits you to utilize portions of the Covered Code under Your
|
||||
choice of the MPL or the alternative licenses, if any, specified by the
|
||||
Initial Developer in the file described in Exhibit A.</UL>
|
||||
Initial Developer in the file described in Exhibit A.
|
||||
</UL>
|
||||
<P><BR><B>EXHIBIT A -Mozilla Public License.</B>
|
||||
<UL>The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.1 (the "License"); you may not use this file except in compliance
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Javassist License</TITLE>
|
||||
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
|
||||
<META content="MSHTML 5.50.4916.2300" name=GENERATOR></HEAD>
|
||||
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
|
||||
<META content="MSHTML 5.50.4916.2300" name=GENERATOR>
|
||||
</HEAD>
|
||||
|
||||
<BODY text=#000000 vLink=#551a8b aLink=#ff0000 link=#0000ee bgColor=#ffffff>
|
||||
<BODY aLink=#ff0000 bgColor=#ffffff link=#0000ee text=#000000 vLink=#551a8b>
|
||||
<CENTER><B><FONT size=+2>MOZILLA PUBLIC LICENSE</FONT></B> <BR><B>Version
|
||||
1.1</B>
|
||||
<P>
|
||||
@@ -42,7 +43,8 @@
|
||||
<UL><B>A.</B> Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
<P><B>B.</B> Any new file that contains any part of the Original Code or
|
||||
previous Modifications. <BR> </P></UL><B>1.10. ''Original Code''</B>
|
||||
previous Modifications. <BR> </P></UL>
|
||||
<B>1.10. ''Original Code''</B>
|
||||
means Source Code of computer software code which is described in the Source
|
||||
Code notice required by <B>Exhibit A</B> as Original Code, and which, at the
|
||||
time of its release under this License is not already Covered Code governed by
|
||||
@@ -66,7 +68,8 @@
|
||||
means (a) the power, direct or indirect, to cause the direction or management
|
||||
of such entity, whether by contract or otherwise, or (b) ownership of more
|
||||
than fifty percent (50%) of the outstanding shares or beneficial ownership of
|
||||
such entity.</P></UL><B>2. Source Code License.</B>
|
||||
such entity.</P></UL>
|
||||
<B>2. Source Code License.</B>
|
||||
<UL><B>2.1. The Initial Developer Grant.</B> <BR>The Initial Developer hereby
|
||||
grants You a world-wide, royalty-free, non-exclusive license, subject to third
|
||||
party intellectual property claims:
|
||||
@@ -79,14 +82,17 @@
|
||||
of Original Code, to make, have made, use, practice, sell, and offer for
|
||||
sale, and/or otherwise dispose of the Original Code (or portions thereof).
|
||||
<UL>
|
||||
<UL></UL></UL><B>(c) </B>the licenses granted in this Section 2.1(a) and (b)
|
||||
<UL></UL>
|
||||
</UL>
|
||||
<B>(c) </B>the licenses granted in this Section 2.1(a) and (b)
|
||||
are effective on the date Initial Developer first distributes Original Code
|
||||
under the terms of this License.
|
||||
<P><B>(d) </B>Notwithstanding Section 2.1(b) above, no patent license is
|
||||
granted: 1) for code that You delete from the Original Code; 2) separate
|
||||
from the Original Code; or 3) for infringements caused by: i) the
|
||||
modification of the Original Code or ii) the combination of the Original
|
||||
Code with other software or devices. <BR> </P></UL><B>2.2. Contributor
|
||||
Code with other software or devices. <BR> </P></UL>
|
||||
<B>2.2. Contributor
|
||||
Grant.</B> <BR>Subject to third party intellectual property claims, each
|
||||
Contributor hereby grants You a world-wide, royalty-free, non-exclusive
|
||||
license
|
||||
@@ -115,7 +121,8 @@
|
||||
Modifications made by that Contributor with other software (except as
|
||||
part of the Contributor Version) or other devices; or 4) under Patent Claims
|
||||
infringed by Covered Code in the absence of Modifications made by that
|
||||
Contributor.</P></UL></UL>
|
||||
Contributor.</P></UL>
|
||||
</UL>
|
||||
<P><BR><B>3. Distribution Obligations.</B>
|
||||
<UL><B>3.1. Application of License.</B> <BR>The Modifications which You create
|
||||
or to which You contribute are governed by the terms of this License,
|
||||
@@ -168,7 +175,8 @@
|
||||
<UL>Contributor represents that, except as disclosed pursuant to Section
|
||||
3.4(a) above, Contributor believes that Contributor's Modifications are
|
||||
Contributor's original creation(s) and/or Contributor has sufficient rights
|
||||
to grant the rights conveyed by this License.</UL>
|
||||
to grant the rights conveyed by this License.
|
||||
</UL>
|
||||
<P><BR><B>3.5. Required Notices.</B> <BR>You must duplicate the notice in
|
||||
<B>Exhibit A</B> in each file of the Source Code. If it is not possible
|
||||
to put such notice in a particular Source Code file due to its structure, then
|
||||
@@ -210,7 +218,8 @@
|
||||
Covered Code with other code not governed by the terms of this License and
|
||||
distribute the Larger Work as a single product. In such a case, You must make
|
||||
sure the requirements of this License are fulfilled for the Covered
|
||||
Code.</P></UL><B>4. Inability to Comply Due to Statute or Regulation.</B>
|
||||
Code.</P></UL>
|
||||
<B>4. Inability to Comply Due to Statute or Regulation.</B>
|
||||
<UL>If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to statute,
|
||||
judicial order, or regulation then You must: (a) comply with the terms of this
|
||||
@@ -219,9 +228,13 @@ Code.</P></UL><B>4. Inability to Comply Due to Statute or Regulation.</B>
|
||||
described in Section <B>3.4</B> and must be included with all distributions of
|
||||
the Source Code. Except to the extent prohibited by statute or regulation,
|
||||
such description must be sufficiently detailed for a recipient of ordinary
|
||||
skill to be able to understand it.</UL><B>5. Application of this License.</B>
|
||||
skill to be able to understand it.
|
||||
</UL>
|
||||
<B>5. Application of this License.</B>
|
||||
<UL>This License applies to code to which the Initial Developer has attached
|
||||
the notice in <B>Exhibit A</B> and to related Covered Code.</UL><B>6. Versions
|
||||
the notice in <B>Exhibit A</B> and to related Covered Code.
|
||||
</UL>
|
||||
<B>6. Versions
|
||||
of the License.</B>
|
||||
<UL><B>6.1. New Versions</B>. <BR>Netscape Communications Corporation
|
||||
(''Netscape'') may publish revised and/or new versions of the License from
|
||||
@@ -242,7 +255,8 @@ of the License.</B>
|
||||
terms which differ from the Mozilla Public License and Netscape Public
|
||||
License. (Filling in the name of the Initial Developer, Original Code or
|
||||
Contributor in the notice described in <B>Exhibit A</B> shall not of
|
||||
themselves be deemed to be modifications of this License.)</P></UL><B>7.
|
||||
themselves be deemed to be modifications of this License.)</P></UL>
|
||||
<B>7.
|
||||
DISCLAIMER OF WARRANTY.</B>
|
||||
<UL>COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
|
||||
@@ -253,7 +267,9 @@ DISCLAIMER OF WARRANTY.</B>
|
||||
OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
|
||||
LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
|
||||
DISCLAIMER.</UL><B>8. TERMINATION.</B>
|
||||
DISCLAIMER.
|
||||
</UL>
|
||||
<B>8. TERMINATION.</B>
|
||||
<UL><B>8.1. </B>This License and the rights granted hereunder will
|
||||
terminate automatically if You fail to comply with terms herein and fail to
|
||||
cure such breach within 30 days of becoming aware of the breach. All
|
||||
@@ -292,7 +308,8 @@ DISCLAIMER OF WARRANTY.</B>
|
||||
<P><B>8.4.</B> In the event of termination under Sections 8.1 or 8.2
|
||||
above, all end user license agreements (excluding distributors and
|
||||
resellers) which have been validly granted by You or any distributor hereunder
|
||||
prior to termination shall survive termination.</P></UL><B>9. LIMITATION OF
|
||||
prior to termination shall survive termination.</P></UL>
|
||||
<B>9. LIMITATION OF
|
||||
LIABILITY.</B>
|
||||
<UL>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
|
||||
NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
|
||||
@@ -306,13 +323,17 @@ LIABILITY.</B>
|
||||
INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR
|
||||
LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND
|
||||
LIMITATION MAY NOT APPLY TO YOU.</UL><B>10. U.S. GOVERNMENT END USERS.</B>
|
||||
LIMITATION MAY NOT APPLY TO YOU.
|
||||
</UL>
|
||||
<B>10. U.S. GOVERNMENT END USERS.</B>
|
||||
<UL>The Covered Code is a ''commercial item,'' as that term is defined in 48
|
||||
C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and
|
||||
''commercial computer software documentation,'' as such terms are used in 48
|
||||
C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R.
|
||||
227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users
|
||||
acquire Covered Code with only those rights set forth herein.</UL><B>11.
|
||||
acquire Covered Code with only those rights set forth herein.
|
||||
</UL>
|
||||
<B>11.
|
||||
MISCELLANEOUS.</B>
|
||||
<UL>This License represents the complete agreement concerning subject matter
|
||||
hereof. If any provision of this License is held to be unenforceable, such
|
||||
@@ -329,18 +350,23 @@ MISCELLANEOUS.</B>
|
||||
Nations Convention on Contracts for the International Sale of Goods is
|
||||
expressly excluded. Any law or regulation which provides that the language of
|
||||
a contract shall be construed against the drafter shall not apply to this
|
||||
License.</UL><B>12. RESPONSIBILITY FOR CLAIMS.</B>
|
||||
License.
|
||||
</UL>
|
||||
<B>12. RESPONSIBILITY FOR CLAIMS.</B>
|
||||
<UL>As between Initial Developer and the Contributors, each party is
|
||||
responsible for claims and damages arising, directly or indirectly, out of its
|
||||
utilization of rights under this License and You agree to work with Initial
|
||||
Developer and Contributors to distribute such responsibility on an equitable
|
||||
basis. Nothing herein is intended or shall be deemed to constitute any
|
||||
admission of liability.</UL><B>13. MULTIPLE-LICENSED CODE.</B>
|
||||
admission of liability.
|
||||
</UL>
|
||||
<B>13. MULTIPLE-LICENSED CODE.</B>
|
||||
<UL>Initial Developer may designate portions of the Covered Code as
|
||||
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
|
||||
Developer permits you to utilize portions of the Covered Code under Your
|
||||
choice of the MPL or the alternative licenses, if any, specified by the
|
||||
Initial Developer in the file described in Exhibit A.</UL>
|
||||
Initial Developer in the file described in Exhibit A.
|
||||
</UL>
|
||||
<P><BR><B>EXHIBIT A -Mozilla Public License.</B>
|
||||
<UL>The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.1 (the "License"); you may not use this file except in compliance
|
||||
|
||||
Reference in New Issue
Block a user