001: /*
002: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
004: *
005: * This program is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU General Public License version
007: * 2 only, as published by the Free Software Foundation.
008: *
009: * This program is distributed in the hope that it will be useful, but
010: * WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * General Public License version 2 for more details (a copy is
013: * included at /legal/license.txt).
014: *
015: * You should have received a copy of the GNU General Public License
016: * version 2 along with this work; if not, write to the Free Software
017: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
018: * 02110-1301 USA
019: *
020: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
021: * Clara, CA 95054 or visit www.sun.com if you need additional
022: * information or have any questions.
023: */
024:
025: package com.sun.jumpimpl.module.download;
026:
027: import com.sun.jump.module.download.JUMPDownloadDescriptor;
028: import com.sun.jump.module.download.JUMPDownloadException;
029:
030: import java.net.URL;
031: import java.net.MalformedURLException;
032:
033: public class OMADownloadDescriptor extends BaseDownloadDescriptor {
034: /**
035: * A URI (URL) used to provide further
036: * information describing the media object.
037: */
038: protected String infoURI = null;
039:
040: /**
041: * Whether user interaction is allowed.
042: */
043: protected boolean userInteraction = true;
044:
045: /**
046: * The URI (URL) to which the client should
047: * navigate if the user elects to invoke a browsing
048: * action after the download is done. This allows
049: * the download service to continue user interaction
050: * after the download is complete (whether successful
051: * or not).
052: */
053: protected String nextURI = null;
054:
055: public OMADownloadDescriptor(String schema, String source) {
056: super (schema, source);
057: }
058:
059: /**
060: * Return the URI from which to request more information
061: * about this media object (may be null).
062: */
063: public String getInfoURI() {
064: return infoURI;
065: }
066:
067: /**
068: * Indicate whether or not user interaction is allowed
069: * for this media object.
070: */
071: public boolean getInteraction() {
072: return userInteraction;
073: }
074:
075: /**
076: * Return the nextURI value for this media object
077: * (may be null).
078: */
079: public String getNextURI() {
080: return nextURI;
081: }
082:
083: /**
084: * Set the infoURI for this media object.
085: * @param uri The URI (URL) which provides more information
086: * about the media object.
087: * @throws SyntaxException if the parameter is an invalid
088: * URL.
089: */
090: public void setInfoURI(String uri) throws SyntaxException {
091: checkURL(uri);
092: infoURI = uri;
093: return;
094: }
095:
096: /**
097: * Set option of whether or not to allow user interaction.
098: * @param user True or false.
099: */
100: public void setInteraction(boolean user) throws SyntaxException {
101: userInteraction = user;
102: return;
103: }
104:
105: /**
106: * Set the nextURI value for this media object, to which the
107: * client should navigate after installation (whether successful
108: * or not) if the user selects a browsing option.
109: * @param uri the URI to which to navigate
110: * @throws SyntaxException if the URI is invalid.
111: */
112: public void setNextURI(String uri) throws SyntaxException {
113: checkURL(uri);
114: nextURI = uri;
115: return;
116: }
117: }
|