aboutsummaryrefslogtreecommitdiffstats
path: root/netx/javax
diff options
context:
space:
mode:
Diffstat (limited to 'netx/javax')
-rw-r--r--netx/javax/jnlp/BasicService.java12
-rw-r--r--netx/javax/jnlp/ClipboardService.java10
-rw-r--r--netx/javax/jnlp/DownloadService.java24
-rw-r--r--netx/javax/jnlp/DownloadServiceListener.java12
-rw-r--r--netx/javax/jnlp/ExtendedService.java51
-rw-r--r--netx/javax/jnlp/ExtensionInstallerService.java21
-rw-r--r--netx/javax/jnlp/FileContents.java17
-rw-r--r--netx/javax/jnlp/FileOpenService.java10
-rw-r--r--netx/javax/jnlp/FileSaveService.java10
-rw-r--r--netx/javax/jnlp/JNLPRandomAccessFile.java45
-rw-r--r--netx/javax/jnlp/PersistenceService.java17
-rw-r--r--netx/javax/jnlp/PrintService.java12
-rw-r--r--netx/javax/jnlp/ServiceManager.java53
-rw-r--r--netx/javax/jnlp/ServiceManagerStub.java10
-rw-r--r--netx/javax/jnlp/SingleInstanceListener.java35
-rw-r--r--netx/javax/jnlp/SingleInstanceService.java46
-rw-r--r--netx/javax/jnlp/UnavailableServiceException.java15
17 files changed, 400 insertions, 0 deletions
diff --git a/netx/javax/jnlp/BasicService.java b/netx/javax/jnlp/BasicService.java
new file mode 100644
index 0000000..cb9a445
--- /dev/null
+++ b/netx/javax/jnlp/BasicService.java
@@ -0,0 +1,12 @@
+
+
+package javax.jnlp;
+
+public interface BasicService {
+
+ public java.net.URL getCodeBase();
+ public boolean isOffline();
+ public boolean showDocument(java.net.URL url);
+ public boolean isWebBrowserSupported();
+
+}
diff --git a/netx/javax/jnlp/ClipboardService.java b/netx/javax/jnlp/ClipboardService.java
new file mode 100644
index 0000000..cada884
--- /dev/null
+++ b/netx/javax/jnlp/ClipboardService.java
@@ -0,0 +1,10 @@
+
+
+package javax.jnlp;
+
+public interface ClipboardService {
+
+ public java.awt.datatransfer.Transferable getContents();
+ public void setContents(java.awt.datatransfer.Transferable contents);
+
+}
diff --git a/netx/javax/jnlp/DownloadService.java b/netx/javax/jnlp/DownloadService.java
new file mode 100644
index 0000000..6710fc6
--- /dev/null
+++ b/netx/javax/jnlp/DownloadService.java
@@ -0,0 +1,24 @@
+
+
+package javax.jnlp;
+
+public interface DownloadService {
+
+ public boolean isResourceCached(java.net.URL ref, java.lang.String version);
+ public boolean isPartCached(java.lang.String part);
+ public boolean isPartCached(java.lang.String[] parts);
+ public boolean isExtensionPartCached(java.net.URL ref, java.lang.String version, java.lang.String part);
+ public boolean isExtensionPartCached(java.net.URL ref, java.lang.String version, java.lang.String[] parts);
+ public void loadResource(java.net.URL ref, java.lang.String version, DownloadServiceListener progress) throws java.io.IOException;
+ public void loadPart(java.lang.String part, DownloadServiceListener progress) throws java.io.IOException;
+ public void loadPart(java.lang.String[] parts, DownloadServiceListener progress) throws java.io.IOException;
+ public void loadExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String part, DownloadServiceListener progress) throws java.io.IOException;
+ public void loadExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String[] parts, DownloadServiceListener progress) throws java.io.IOException;
+ public void removeResource(java.net.URL ref, java.lang.String version) throws java.io.IOException;
+ public void removePart(java.lang.String part) throws java.io.IOException;
+ public void removePart(java.lang.String[] parts) throws java.io.IOException;
+ public void removeExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String part) throws java.io.IOException;
+ public void removeExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String[] parts) throws java.io.IOException;
+ public DownloadServiceListener getDefaultProgressWindow();
+
+}
diff --git a/netx/javax/jnlp/DownloadServiceListener.java b/netx/javax/jnlp/DownloadServiceListener.java
new file mode 100644
index 0000000..4d0fba3
--- /dev/null
+++ b/netx/javax/jnlp/DownloadServiceListener.java
@@ -0,0 +1,12 @@
+
+
+package javax.jnlp;
+
+public interface DownloadServiceListener {
+
+ public void progress(java.net.URL url, java.lang.String version, long readSoFar, long total, int overallPercent);
+ public void validating(java.net.URL url, java.lang.String version, long entry, long total, int overallPercent);
+ public void upgradingArchive(java.net.URL url, java.lang.String version, int patchPercent, int overallPercent);
+ public void downloadFailed(java.net.URL url, java.lang.String version);
+
+}
diff --git a/netx/javax/jnlp/ExtendedService.java b/netx/javax/jnlp/ExtendedService.java
new file mode 100644
index 0000000..b70a42b
--- /dev/null
+++ b/netx/javax/jnlp/ExtendedService.java
@@ -0,0 +1,51 @@
+// Copyright (C) 2009 Red Hat, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+package javax.jnlp;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * This interface provides a way for the JNLP application to open specific files
+ * in the client's system. It asks permission from the user before opening any
+ * files.
+ *
+ * @author <a href="mailto:[email protected]">Omair Majid</a>
+ *
+ */
+public interface ExtendedService {
+
+ /**
+ * Open a file on the client' system and return its contents. The user must
+ * grant permission to the application for this to work.
+ *
+ * @param file the file to open
+ * @return the opened file as a {@link FileContents} object
+ * @throws IOException on any io problems
+ */
+ FileContents openFile(File file) throws IOException;
+
+ /**
+ * Opens multiple files on the user's sytem and returns their contents as a
+ * {@link FileContents} array
+ *
+ * @param files the files to open
+ * @return an array of FileContents objects
+ * @throws IOException on any io problems
+ */
+ FileContents[] openFiles(File[] files) throws IOException;
+}
diff --git a/netx/javax/jnlp/ExtensionInstallerService.java b/netx/javax/jnlp/ExtensionInstallerService.java
new file mode 100644
index 0000000..a3b686c
--- /dev/null
+++ b/netx/javax/jnlp/ExtensionInstallerService.java
@@ -0,0 +1,21 @@
+
+
+package javax.jnlp;
+
+public interface ExtensionInstallerService {
+
+ public java.lang.String getInstallPath();
+ public java.lang.String getExtensionVersion();
+ public java.net.URL getExtensionLocation();
+ public void hideProgressBar();
+ public void hideStatusWindow();
+ public void setHeading(java.lang.String heading);
+ public void setStatus(java.lang.String status);
+ public void updateProgress(int value);
+ public void installSucceeded(boolean needsReboot);
+ public void installFailed();
+ public void setJREInfo(java.lang.String platformVersion, java.lang.String jrePath);
+ public void setNativeLibraryInfo(java.lang.String path);
+ public java.lang.String getInstalledJRE(java.net.URL url, java.lang.String version);
+
+}
diff --git a/netx/javax/jnlp/FileContents.java b/netx/javax/jnlp/FileContents.java
new file mode 100644
index 0000000..a612202
--- /dev/null
+++ b/netx/javax/jnlp/FileContents.java
@@ -0,0 +1,17 @@
+
+
+package javax.jnlp;
+
+public interface FileContents {
+
+ public java.lang.String getName() throws java.io.IOException;
+ public java.io.InputStream getInputStream() throws java.io.IOException;
+ public java.io.OutputStream getOutputStream(boolean overwrite) throws java.io.IOException;
+ public long getLength() throws java.io.IOException;
+ public boolean canRead() throws java.io.IOException;
+ public boolean canWrite() throws java.io.IOException;
+ public JNLPRandomAccessFile getRandomAccessFile(java.lang.String mode) throws java.io.IOException;
+ public long getMaxLength() throws java.io.IOException;
+ public long setMaxLength(long maxlength) throws java.io.IOException;
+
+}
diff --git a/netx/javax/jnlp/FileOpenService.java b/netx/javax/jnlp/FileOpenService.java
new file mode 100644
index 0000000..1ca5ee9
--- /dev/null
+++ b/netx/javax/jnlp/FileOpenService.java
@@ -0,0 +1,10 @@
+
+
+package javax.jnlp;
+
+public interface FileOpenService {
+
+ public FileContents openFileDialog(java.lang.String pathHint, java.lang.String[] extensions) throws java.io.IOException;
+ public FileContents[] openMultiFileDialog(java.lang.String pathHint, java.lang.String[] extensions) throws java.io.IOException;
+
+}
diff --git a/netx/javax/jnlp/FileSaveService.java b/netx/javax/jnlp/FileSaveService.java
new file mode 100644
index 0000000..b06d761
--- /dev/null
+++ b/netx/javax/jnlp/FileSaveService.java
@@ -0,0 +1,10 @@
+
+
+package javax.jnlp;
+
+public interface FileSaveService {
+
+ public FileContents saveFileDialog(java.lang.String pathHint, java.lang.String[] extensions, java.io.InputStream stream, java.lang.String name) throws java.io.IOException;
+ public FileContents saveAsFileDialog(java.lang.String pathHint, java.lang.String[] extensions, FileContents contents) throws java.io.IOException;
+
+}
diff --git a/netx/javax/jnlp/JNLPRandomAccessFile.java b/netx/javax/jnlp/JNLPRandomAccessFile.java
new file mode 100644
index 0000000..3d67fce
--- /dev/null
+++ b/netx/javax/jnlp/JNLPRandomAccessFile.java
@@ -0,0 +1,45 @@
+
+
+package javax.jnlp;
+public interface JNLPRandomAccessFile extends java.io.DataInput, java.io.DataOutput {
+
+
+ public void close() throws java.io.IOException;
+ public long length() throws java.io.IOException;
+ public long getFilePointer() throws java.io.IOException;
+ public int read() throws java.io.IOException;
+ public int read(byte[] b, int off, int len) throws java.io.IOException;
+ public int read(byte[] b) throws java.io.IOException;
+ public void readFully(byte[] b) throws java.io.IOException;
+ public void readFully(byte[] b, int off, int len) throws java.io.IOException;
+ public int skipBytes(int n) throws java.io.IOException;
+ public boolean readBoolean() throws java.io.IOException;
+ public byte readByte() throws java.io.IOException;
+ public int readUnsignedByte() throws java.io.IOException;
+ public short readShort() throws java.io.IOException;
+ public int readUnsignedShort() throws java.io.IOException;
+ public char readChar() throws java.io.IOException;
+ public int readInt() throws java.io.IOException;
+ public long readLong() throws java.io.IOException;
+ public float readFloat() throws java.io.IOException;
+ public double readDouble() throws java.io.IOException;
+ public java.lang.String readLine() throws java.io.IOException;
+ public java.lang.String readUTF() throws java.io.IOException;
+ public void seek(long pos) throws java.io.IOException;
+ public void setLength(long newLength) throws java.io.IOException;
+ public void write(int b) throws java.io.IOException;
+ public void write(byte[] b) throws java.io.IOException;
+ public void write(byte[] b, int off, int len) throws java.io.IOException;
+ public void writeBoolean(boolean v) throws java.io.IOException;
+ public void writeByte(int v) throws java.io.IOException;
+ public void writeShort(int v) throws java.io.IOException;
+ public void writeChar(int v) throws java.io.IOException;
+ public void writeInt(int v) throws java.io.IOException;
+ public void writeLong(long v) throws java.io.IOException;
+ public void writeFloat(float v) throws java.io.IOException;
+ public void writeDouble(double v) throws java.io.IOException;
+ public void writeBytes(java.lang.String s) throws java.io.IOException;
+ public void writeChars(java.lang.String s) throws java.io.IOException;
+ public void writeUTF(java.lang.String str) throws java.io.IOException;
+
+}
diff --git a/netx/javax/jnlp/PersistenceService.java b/netx/javax/jnlp/PersistenceService.java
new file mode 100644
index 0000000..008c670
--- /dev/null
+++ b/netx/javax/jnlp/PersistenceService.java
@@ -0,0 +1,17 @@
+
+package javax.jnlp;
+
+public interface PersistenceService {
+
+ public static final int CACHED = 0;
+ public static final int TEMPORARY = 1;
+ public static final int DIRTY = 2;
+
+ public long create(java.net.URL url, long maxsize) throws java.net.MalformedURLException, java.io.IOException;
+ public FileContents get(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException, java.io.FileNotFoundException;
+ public void delete(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException;
+ public java.lang.String[] getNames(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException;
+ public int getTag(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException;
+ public void setTag(java.net.URL url, int tag) throws java.net.MalformedURLException, java.io.IOException;
+
+}
diff --git a/netx/javax/jnlp/PrintService.java b/netx/javax/jnlp/PrintService.java
new file mode 100644
index 0000000..7573233
--- /dev/null
+++ b/netx/javax/jnlp/PrintService.java
@@ -0,0 +1,12 @@
+
+
+package javax.jnlp;
+
+public interface PrintService {
+
+ public java.awt.print.PageFormat getDefaultPage();
+ public java.awt.print.PageFormat showPageFormatDialog(java.awt.print.PageFormat page);
+ public boolean print(java.awt.print.Pageable document);
+ public boolean print(java.awt.print.Printable painter);
+
+}
diff --git a/netx/javax/jnlp/ServiceManager.java b/netx/javax/jnlp/ServiceManager.java
new file mode 100644
index 0000000..3488b3c
--- /dev/null
+++ b/netx/javax/jnlp/ServiceManager.java
@@ -0,0 +1,53 @@
+
+
+
+package javax.jnlp;
+
+import java.util.*;
+
+
+public final class ServiceManager {
+
+ private static ServiceManagerStub stub = null;
+
+ private static Map lookupTable = new HashMap(); // ensure lookup is idempotent
+
+ private ServiceManager() {
+ // says it can't be instantiated
+ }
+
+
+ public static java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException {
+ if (stub == null)
+ throw new UnavailableServiceException("service stub not set.");
+
+ synchronized(lookupTable) {
+ Object result = lookupTable.get(name);
+
+ if (result == null) {
+ result = stub.lookup(name);
+ if (result != null)
+ lookupTable.put(name, result);
+ }
+
+ if (result == null)
+ throw new UnavailableServiceException("service not available (stub returned null).");
+
+ return result;
+ }
+ }
+
+ public static java.lang.String[] getServiceNames() {
+ // should this return the required ones even though no stub??
+ if (stub == null)
+ return new String[0];
+
+ return stub.getServiceNames();
+ }
+
+ public static void setServiceManagerStub(ServiceManagerStub stub) {
+ if (ServiceManager.stub == null)
+ ServiceManager.stub = stub;
+ }
+
+}
diff --git a/netx/javax/jnlp/ServiceManagerStub.java b/netx/javax/jnlp/ServiceManagerStub.java
new file mode 100644
index 0000000..04af1dd
--- /dev/null
+++ b/netx/javax/jnlp/ServiceManagerStub.java
@@ -0,0 +1,10 @@
+
+
+package javax.jnlp;
+
+public interface ServiceManagerStub {
+
+ public java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException;
+ public java.lang.String[] getServiceNames();
+
+}
diff --git a/netx/javax/jnlp/SingleInstanceListener.java b/netx/javax/jnlp/SingleInstanceListener.java
new file mode 100644
index 0000000..f40a631
--- /dev/null
+++ b/netx/javax/jnlp/SingleInstanceListener.java
@@ -0,0 +1,35 @@
+// Copyright (C) 2009 Red Hat, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+package javax.jnlp;
+
+/**
+ * This interface specifies a listener which is notified whenever a new instance
+ * of the web start application is launched.
+ *
+ */
+public interface SingleInstanceListener {
+
+ /**
+ * This method is called when a new instance of the application is launched.
+ * The arguments passed to the new instance are passed into this method.
+ *
+ * @param arguments the arguments passed to the new instance of the
+ * application
+ */
+ void newActivation(String[] arguments);
+
+}
diff --git a/netx/javax/jnlp/SingleInstanceService.java b/netx/javax/jnlp/SingleInstanceService.java
new file mode 100644
index 0000000..1eb9ddc
--- /dev/null
+++ b/netx/javax/jnlp/SingleInstanceService.java
@@ -0,0 +1,46 @@
+// Copyright (C) 2009 Red Hat, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+package javax.jnlp;
+
+/**
+ * The SingleInstanceService provides a way to ensure that only one instance of
+ * the application is ever running - singleton behavior at the application
+ * level.
+ *
+ */
+public interface SingleInstanceService {
+
+ /**
+ * Adds the specified SingleInstanceListener to the notification list. This
+ * listener is notified when a new instance of the application is started.
+ *
+ *
+ * @param listener the single instance listener to be added. No action is
+ * performed if it is null.
+ */
+ void addSingleInstanceListener(SingleInstanceListener listener);
+
+ /**
+ * Removes the specified SingleInstanceListener from the notification list.
+ * This listener will not be notified if a new instance of the application
+ * is started.
+ *
+ * @param listener the single instance listener to be removed. No action is
+ * performed if it is null or not in the notification list.
+ */
+ void removeSingleInstanceListener(SingleInstanceListener listener);
+}
diff --git a/netx/javax/jnlp/UnavailableServiceException.java b/netx/javax/jnlp/UnavailableServiceException.java
new file mode 100644
index 0000000..b5c342d
--- /dev/null
+++ b/netx/javax/jnlp/UnavailableServiceException.java
@@ -0,0 +1,15 @@
+
+
+package javax.jnlp;
+
+public class UnavailableServiceException extends Exception {
+
+ public UnavailableServiceException() {
+ super();
+ }
+
+ public UnavailableServiceException(java.lang.String message) {
+ super(message);
+ }
+
+}