/** * get the shared instance of APR library, if none, initialize one * * @return the current APR library singleton */ public static synchronized AprLibrary getInstance() { if (!isInitialized()) { initialize(); } return library; }
/** * get the shared instance of APR library, if none, initialize one * * @return the current APR library singleton */ public static synchronized AprLibrary getInstance() { if (!isInitialized()) { initialize(); } return library; }
static String createLocalSocketAddress() throws IOException { initialize(); String name; if (OsUtils.isUNIX()) { // Since there is a race condition between bind and when // we can mark the socket readable only by its owner, make // the socket in a temporary directory that is visible only // to the owner. // File dir = File.createTempFile("mina", "apr"); if (!dir.delete() || !dir.mkdir()) { throw new IOException("Cannot create secure temp directory"); } chmodOwner(dir.getAbsolutePath(), true); File socket = File.createTempFile("mina", "apr", dir); socket.delete(); name = socket.getAbsolutePath(); } else { File socket = File.createTempFile("mina", "apr"); socket.delete(); name = "\\\\.\\pipe\\" + socket.getName(); } return name; }
static String createLocalSocketAddress() throws IOException { initialize(); String name; if (OsUtils.isUNIX()) { // Since there is a race condition between bind and when // we can mark the socket readable only by its owner, make // the socket in a temporary directory that is visible only // to the owner. // File dir = File.createTempFile("mina", "apr"); if (!dir.delete() || !dir.mkdir()) { throw new IOException("Cannot create secure temp directory"); } chmodOwner(dir.getAbsolutePath(), true); File socket = File.createTempFile("mina", "apr", dir); socket.delete(); name = socket.getAbsolutePath(); } else { File socket = File.createTempFile("mina", "apr"); socket.delete(); name = "\\\\.\\pipe\\" + socket.getName(); } return name; }