Java 8 UnknownServiceException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 UnknownServiceException class.

This code example shows how to use the following methods:
     * @tests java.net.UnknownServiceException#UnknownServiceException() 
     */ 
    public void test_Constructor() { 
        try { 
            if (true) { 
                throw new UnknownServiceException();
            } 
            fail("Exception not thrown");
        } catch (UnknownServiceException e) {
            // Expected 
        } 
    } 
 
    /** 
     * @tests java.net.UnknownServiceException#UnknownServiceException(java.lang.String) 
     */ 
    public void test_ConstructorLjava_lang_String() { 
        try { 
            if (true) { 
                throw new UnknownServiceException("test");
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        return impl.getSocketAddress();
    } 
     
    @Override 
    public void bind(SocketAddress bindpoint) throws IOException {
        throw new UnknownServiceException();
    } 
     
    @Override 
    public SocketChannel getChannel()  {
        return null; 
    } 
     
    @Override 
    public InetAddress getInetAddress() {
        if (!isConnected()) { 
            return null; 
        } 
        throw new IllegalArgumentException("Unsupported address type");
    } 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
   * Returns an output stream that writes to this connection. 
   */ 
  public OutputStream getOutputStream()
    throws IOException 
  { 
    throw new UnknownServiceException();
  } 
 
  public Object getContent()
    throws IOException 
  { 
    return new GopherContentHandler().getContent(this);
  } 
 
  public Object getContent(Class[] classes)
    throws IOException 
  { 
    return new GopherContentHandler().getContent(this, classes);
  } 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    } 
 
    @Override 
    protected void accept(SocketImpl s) throws IOException {
        if (!(s instanceof LocalSocketImpl)) {
            throw new UnknownServiceException();
        } 
        ((LocalSocketImpl)s).socket = nativeAccept(this.socket);
        ((LocalSocketImpl)s).connected = true;
        ((LocalSocketImpl)s).endpoint = endpoint;
    } 
 
    @Override 
    protected int available() throws IOException {
        return nativeAvailable(socket);
    } 
 
    @Override 
    protected void bind(InetAddress host, int port) throws IOException {
        throw new UnknownServiceException();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
     * DataSource method to return an output stream. <p> 
     * 
     * This implementation throws the UnknownServiceException. 
     */ 
    public OutputStream getOutputStream() throws IOException { 
	throw new UnknownServiceException("Writing not supported"); 
    } 
 
    /** 
     * Returns the content-type of this DataSource. <p> 
     * 
     * This implementation just invokes the <code>getContentType</code> 
     * method on the MimePart. 
     */ 
    public String getContentType() { 
	try { 
	    return part.getContentType(); 
	} catch (MessagingException mex) { 
	    // would like to be able to reflect the exception to the 
	    // application, but since we can't do that we return a 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            // here we don't know what the caller wants. 
            throw new UnknownServiceException("VRS: Location is a directory:" + node);
        } 
        else 
        { 
            throw new UnknownServiceException("VRS: Location is not streamreadable:" + node);
        } 
    } 
 
    public OutputStream getOutputStream() throws IOException
    { 
        if (this.connected == false)
            connect(); 
 
        if (node instanceof VStreamReadable)
        { 
            return ((VStreamWritable) node).createOutputStream();
        } 
        else if (node instanceof VDir)
        { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 UnknownServiceException Methods: