congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
javax.jnlp
Code IndexAdd Tabnine to your IDE (free)

How to use javax.jnlp

Best Java code snippets using javax.jnlp (Showing top 20 results out of 315)

origin: org.jvnet.hudson/netx

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();
}
origin: org.jvnet.hudson/netx

/**
 * Returns the service, or null instead of an UnavailableServiceException
 */
private static Object getService(String name) {
  try {
    return ServiceManager.lookup(name);
  }
  catch (UnavailableServiceException ex) {
    return null;
  }
}
origin: org.jbundle.util/org.jbundle.util.muffinmanager

/**
 * Get the Java WebStart codebase.
 * @return The codebase.
 */
public URL getCodeBase()
{
  if (m_bs != null)
    return m_bs.getCodeBase();
  return null;
}
/**
origin: org.jbundle.util/org.jbundle.util.muffinmanager

/**
 * Open this file.
 * @return
 */
public InputStream openFileStream(String pathHint, String[] extensions)
{
  if (fos == null)
  {
    try { 
      fos = (FileOpenService)ServiceManager.lookup("javax.jnlp.FileOpenService"); 
    } catch (UnavailableServiceException e) { 
      fos = null; 
    }
  }
  if (fos != null) { 
    try { 
      // ask user to select a file through this service 
      FileContents fc = fos.openFileDialog(pathHint, extensions);
      return fc.getInputStream();
    } catch (Exception e) { 
      e.printStackTrace(); 
    } 
  } 
  return null;
}
origin: org.jbundle.util/org.jbundle.util.muffinmanager

/**
 * Creates new MuffinManager.
 * @param applet The parent object (ignored).
 */
public void init(Object applet)
{
  try {
    m_ps = (PersistenceService)ServiceManager.lookup("javax.jnlp.PersistenceService");
    m_bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
    m_strCodeBase = m_bs.getCodeBase().toString();
  } catch (UnavailableServiceException e) {
    m_ps = null;
    m_bs = null;
  }
}
/**
origin: org.jdesktop.bsaf/bsaf

@Override
public InputStream openInputFile(String fileName) throws IOException {
  checkBasics("openInputFile");
  URL fileURL = fileNameToURL(fileName);
  try {
    return new BufferedInputStream(ps.get(fileURL).getInputStream());
  } catch (Exception e) {
    throw new IOException("openInputFile \"" + fileName + "\" failed", e);
  }
}
origin: org.jbundle.util/org.jbundle.util.muffinmanager

/**
 * Get data from the system clipboard.
 * @return
 */
public Transferable getClipboardContents()
{
  if ((clipboardReadStatus & CLIPBOARD_DISABLED) == CLIPBOARD_DISABLED)
    return null;    // Rejected it last time, don't ask again
  clipboardReadStatus = CLIPBOARD_DISABLED;
  if (cs == null)
  {
    try {
      cs = (ClipboardService)ServiceManager.lookup("javax.jnlp.ClipboardService"); 
    } catch (UnavailableServiceException e) { 
      cs = null;
    }
  }
  if (cs != null) { 
    // get the contents of the system clipboard and print them 
    Transferable tr = cs.getContents(); 
    if (tr != null)
      clipboardReadStatus = CLIPBOARD_ENABLED;
    return tr;
  }
  return null;
}
/**
origin: org.jdesktop.bsaf/bsaf

  @Override
  public boolean deleteFile(String fileName) throws IOException {
    checkBasics("deleteFile");
    URL fileURL = fileNameToURL(fileName);
    try {
      ps.delete(fileURL);
      return true;
    } catch (Exception e) {
      throw new IOException("openInputFile \"" + fileName + "\" failed", e);
    }
  }
}
origin: org.jvnet.hudson/netx

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;
 }
}
origin: org.jbundle.util/org.jbundle.util.muffinmanager

/**
 * Display this URL in a web browser.
 * @param url The URL to display.
 * @return True if successfully displayed.
 */
public boolean showTheDocument(URL url)
{
  if (m_bs != null)
    return m_bs.showDocument(url);
  return false;
}
private ClipboardService cs = null;
origin: net.sf.jga/jga

/**
 */
private String getClue(FileContents fc, URL source) {
  if (fc != null) 
    try { return fc.getName(); }
    catch (IOException x) {} // just fall through: failure _is_ an option in this case
  if (source != null)
    return source.getPath();
  return "worksheet.hwks";
}
origin: org.jvnet.hudson/netx

/**
 * Returns the service.
 *
 * @throws UnavailableServiceException if service is not available
 */
public Object lookup(String name) throws UnavailableServiceException {
  // exact match
  for (int i=0; i < serviceNames.length; i++)
    if (serviceNames[i].equals(name))
      return services[i];
  // substring match
  for (int i=0; i < serviceNames.length; i++)
    if (-1 != serviceNames[i].indexOf(name))
      return services[i];
  throw new UnavailableServiceException(""+name);
}
origin: stackoverflow.com

 final BasicService bs = (BasicService) ServiceManager.lookup(
  "javax.jnlp.BasicService");
final URL codeBase = bs.getCodeBase();
origin: net.java.dev.appframework/appframework

public InputStream openInputFile(String fileName) throws IOException {
  checkBasics("openInputFile");
  URL fileURL = fileNameToURL(fileName);
  try {
  return new BufferedInputStream(ps.get(fileURL).getInputStream());
  } 
  catch(Exception e) {
  throw new LSException("openInputFile \"" + fileName + "\" failed", e);
  }
}
origin: org.jdesktop.bsaf/bsaf

PersistenceServiceIO() {
  try {
    bs = (BasicService) ServiceManager.lookup("javax.jnlp.BasicService");
    ps = (PersistenceService) ServiceManager.lookup("javax.jnlp.PersistenceService");
  } catch (UnavailableServiceException e) {
    logger.log(Level.SEVERE, initFailedMessage("ServiceManager.lookup"), e);
    bs = null;
    ps = null;
  }
}
origin: net.java.dev.appframework/appframework

public boolean deleteFile(String fileName) throws IOException {
  checkBasics("deleteFile");
  URL fileURL = fileNameToURL(fileName);
  try {
  ps.delete(fileURL);
      return true;
  } 
  catch(Exception e) {
  throw new LSException("openInputFile \"" + fileName + "\" failed", e);
  }
}
}
origin: stackoverflow.com

 import javax.jnlp.*;

BasicService bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
URL codebase = bs.getCodeBase();
origin: net.java.dev.appframework/appframework

PersistenceServiceIO() {
  try {
  bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
  ps = (PersistenceService)ServiceManager.lookup("javax.jnlp.PersistenceService");
  }
  catch (UnavailableServiceException e) {
  logger.log(Level.SEVERE, initFailedMessage("ServiceManager.lookup"), e);
  bs = null; ps = null;
  }
}
origin: org.jdesktop.bsaf/bsaf

private URL fileNameToURL(String name) throws IOException {
  if (name == null) {
    throw new IOException("name is not set");
  }
  try {
    return new URL(bs.getCodeBase(), name);
  } catch (MalformedURLException e) {
    throw new IOException("invalid filename \"" + name + "\"", e);
  }
}
origin: net.java.dev.appframework/appframework

private URL fileNameToURL(String name) throws IOException {
  try {
  return new URL(bs.getCodeBase(), name);
  }
  catch (MalformedURLException e) {
  throw new LSException("invalid filename \"" + name + "\"", e);
  }
}
javax.jnlp

Most used classes

  • ServiceManager
  • BasicService
  • FileContents
  • PersistenceService
  • DownloadServiceListener
  • ClipboardService,
  • FileSaveService,
  • ServiceManagerStub,
  • UnavailableServiceException
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now