/** * Get spool directory into which messages failed to sent to the record * repository are stored for later re-send. * * @return The directory in which the messages failed to sent are stored, * or {@code null} if the default temporary-file directory is to * be used */ public File getSpoolDirectory() { return spoolDirectory(); }
/** * Get spool directory into which messages failed to sent to the record * repository are stored for later re-send. * * @return The directory in which the messages failed to sent are stored, * or {@code null} if the default temporary-file directory is to * be used */ public File getSpoolDirectory() { return spoolDirectory(); }
public File[] getQueuedMessages() { return spoolDirectory().listFiles(FILENAME_FILTER); }
public File[] getQueuedMessages() { return spoolDirectory().listFiles(FILENAME_FILTER); }
private void spoolMessage(DatagramPacket msg) throws IOException { if (spoolDirectory != null) spoolDirectory.mkdirs(); File f = null; try { f = File.createTempFile(spoolFileNamePrefix, spoolFileNameSuffix, spoolDirectory()); LOG.info("Spool audit message to {}", f); FileOutputStream out = new FileOutputStream(f); try { out.write(msg.getData(), msg.getOffset(), msg.getLength()); } finally { SafeClose.close(out); } f = null; } catch (IOException e) { throw new IOException("Failed to spool audit message", e); } finally { if (f != null) f.delete(); } }
private void spoolMessage(DatagramPacket msg) throws IOException { if (spoolDirectory != null) spoolDirectory.mkdirs(); File f = null; try { f = File.createTempFile(spoolFileNamePrefix, spoolFileNameSuffix, spoolDirectory()); LOG.info("Spool audit message to {}", f); FileOutputStream out = new FileOutputStream(f); try { out.write(msg.getData(), msg.getOffset(), msg.getLength()); } finally { SafeClose.close(out); } f = null; } catch (IOException e) { throw new IOException("Failed to spool audit message", e); } finally { if (f != null) f.delete(); } }
public void sendQueuedMessages() { File dir = spoolDirectory(); try { File[] queuedMessages = dir.listFiles(FILENAME_FILTER);
public void sendQueuedMessages() { File dir = spoolDirectory(); try { File[] queuedMessages = dir.listFiles(FILENAME_FILTER);