protected OutputStream connect() throws IOException { connection = (HttpConnection) Connector.open(postURL); connection.setRequestMethod(HttpConnection.POST); return connection.openOutputStream(); }
/** * @see net.sf.microlog.core.appender.AbstractAppender#open() */ public synchronized void open() throws IOException { if (socketConnection == null && serverName != null) { String connectionString = protocol + serverName + ':' + port; socketConnection = (SocketConnection) Connector .open(connectionString); socketConnection.setSocketOption(SocketConnection.LINGER, linger); dataOutputStream = socketConnection.openDataOutputStream(); logOpen = true; } }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static Connection open(String name) throws IOException { return open(name, READ_WRITE); }
public static OutputStream openOutputStream(String name) throws IOException { OutputConnection con = ((OutputConnection) openImpl(name, WRITE, false, false)); try { return con.openOutputStream(); } finally { con.close(); } }
public static InputStream openInputStream(String name) throws IOException { InputConnection con = ((InputConnection) openImpl(name, READ, false, false)); try { return con.openInputStream(); } finally { con.close(); } }
/** * Close the log. * * @see net.sf.microlog.core.appender.AbstractAppender#close() */ public synchronized void close() throws IOException { if (messageConnection != null) { messageConnection.close(); } logOpen = false; }
UUID serialUUID = new UUID("1101", true); String serviceURL = "btspp://localhost:" + serialUUID + ";name=Android BT Server;authorize=false;authenticate=false"; StreamConnectionNotifier connectionNotifier = (StreamConnectionNotifier) Connector .open(serviceURL); // Blocking method will wait for client to connect StreamConnection connection = connectionNotifier.acceptAndOpen(); RemoteDevice remoteDevice = RemoteDevice.getRemoteDevice(connection); InputStream btInput = connection.openInputStream(); OutputStream btOutput = connection.openOutputStream();
protected InputStream getResponse() throws IOException { int responseCode = connection.getResponseCode(); if (responseCode != HttpConnection.HTTP_OK) { throw new IOException("HTTP response code: " + responseCode); } return connection.openInputStream(); }
public long registerAlarm(String midlet, long time) throws ClassNotFoundException, ConnectionNotFoundException { // TODO Auto-generated method stub throw new ConnectionNotFoundException(); }
public InputStream openInputStream() throws IOException { return ((InputConnection) impl).openInputStream(); }
/** * {@inheritDoc} */ @Override public void close() throws IOException { if ( this.connection != null ) { this.connection.close(); this.connection = null; } }
public DataInputStream openDataInputStream() throws IOException { return ((InputConnection) impl).openDataInputStream(); }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static InputStream openInputStream(String name) throws IOException { return openDataInputStream(name); }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static OutputStream openOutputStream(String name) throws IOException { return openDataOutputStream(name); }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static Connection open(String name, int mode) throws IOException { return open(name, mode, false); }
public void close() throws IOException { StreamConnectionNotifier n = this.notifier; this.notifier = null; if (n != null) { n.close(); } }
/** * Opens the StreamConnectionNotifier. * * @return Server connection opened for clients. * @throws IOException */ private StreamConnectionNotifier createNotifier() throws IOException { return (StreamConnectionNotifier) Connector.open("btspp://localhost:" + DEFAULT_BT_UUID_STRING); }
/** * Discconnect from the server. */ protected void disconnect() throws IOException { connection.close(); }
/** * Open the <code>MessageConnection</code> to use for sending messages. * * @throws IOException * if we fail to open the connection. */ protected synchronized void openConnection(String connectionString) throws IOException { if (messageConnection == null) { messageConnection = (MessageConnection) Connector .open(connectionString); } }
public void close() throws IOException { impl.close(); }