Return Optional {@link WatermarkInterval} for {@link CopyableFile} using {@link CopyableFileWatermarkGenerator}.
183571
public static Optional<WatermarkInterval> getCopyableFileWatermark(CopyableFile copyableFile,
      Optional<CopyableFileWatermarkGenerator> watermarkGenerator)
      throws IOException {
    if (!watermarkGenerator.isPresent()) {
      return Optional.absent();
    }
    return watermarkGenerator.get().generateWatermarkIntervalForCopyableFile(copyableFile);
  }
1312017
private static long adjustWatermark(String baseWatermark, WatermarkType watermarkType) {
    long result = ConfigurationKeys.DEFAULT_WATERMARK_VALUE;
    switch (watermarkType) {
      case SIMPLE:
        result = SimpleWatermark.adjustWatermark(baseWatermark, 0);
        break;
      case DATE:
        result = DateWatermark.adjustWatermark(baseWatermark, 0);
        break;
      case HOUR:
        result = HourWatermark.adjustWatermark(baseWatermark, 0);
        break;
      case TIMESTAMP:
        result = TimestampWatermark.adjustWatermark(baseWatermark, 0);
        break;
    }
    return result;
  }
1028672
@Nonnull
  @ReturnsMutableCopy
  public static HasInputStream once (@Nonnull final ISupplier <? extends InputStream> aISP)
  {
    return new HasInputStream (aISP, false);
  }
1078947
public static synchronized JFileChooser getFileChooser() { // NOPMD
		if (fileChooser == null) {
			final String currentDirectory = System.getProperty("user.dir");
			fileChooser = new JFileChooser(currentDirectory);
		}
		return fileChooser;
	}
1282402
public Node copyFile(Node dest) throws FileNotFoundException, CopyException {
        try (OutputStream out = dest.newOutputStream()) {
            copyFileTo(out);
        } catch (FileNotFoundException e) {
            throw e;
        } catch (IOException e) {
            throw new CopyException(this, dest, e);
        }
        return this;
    }
1176445
public static long copyStream(File dst, InputStream src) throws IOException {
		long copied;

		try (FileOutputStream dstStream = new FileOutputStream(dst)) {
			copied = copyStream(dstStream, src);
		}
		return copied;
	}
57933
function copyFile(source, target) {
    var deferred,
        rd,
        wr;

    if (typeof fs.copyFile === 'function') {
        return Q.ninvoke(fs, 'copyFile', source, target);
    }

    deferred = Q.defer();

    rd = fs.createReadStream(source);
    wr = fs.createWriteStream(target);

    rd.on('error', function (err) {
        deferred.reject(err);
    });

    wr.on('error', function (err) {
        deferred.reject(err);
    });
    wr.on('close', function () {
        deferred.resolve();
    });

    rd.pipe(wr);

    return deferred.promise;
}
428569
public <T extends Watermark> T getExpectedHighWatermark(Class<T> watermarkClass) {
    return getExpectedHighWatermark(watermarkClass, GSON);
  }
1006435
public static BufferedImage cloneImage(BufferedImage bi) {
        ColorModel cm = bi.getColorModel();
        boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
        WritableRaster raster = bi.copyData(null);
        return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
    }
1122072
public static long adjustWatermark(String baseWatermark, int diff) {
    SimpleDateFormat parser = new SimpleDateFormat(INPUTFORMAT);
    try {
      Date date = parser.parse(baseWatermark);
      return Long.parseLong(parser.format(Utils.addSecondsToDate(date, diff)));
    } catch (ParseException e) {
      LOG.error("Fail to adjust timestamp watermark", e);
    }
    return -1;
  }
617174
public Rowtime watermarksPeriodicBounded(long delay) {
		internalProperties.putString(ROWTIME_WATERMARKS_TYPE, ROWTIME_WATERMARKS_TYPE_VALUE_PERIODIC_BOUNDED);
		internalProperties.putLong(ROWTIME_WATERMARKS_DELAY, delay);
		return this;
	}
781786
@Override
    public long getCountLowWaterMark() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getCountLowWaterMark");

        long destLow = _destLowMsgs + getSubscriberCount();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getCountLowWaterMark", Long.valueOf(destLow));
        return destLow;
    }
401983
public static CopyOptions create(Class<?> editable, boolean ignoreNullValue, String... ignoreProperties) {
		return new CopyOptions(editable, ignoreNullValue, ignoreProperties);
	}
445765
protected static String getWatermarkFromPreviousWorkUnits(SourceState state, String watermark) {
    if (state.getPreviousWorkUnitStates().isEmpty()) {
      return ComplianceConfigurationKeys.NO_PREVIOUS_WATERMARK;
    }
    return state.getPreviousWorkUnitStates().get(0)
        .getProp(watermark, ComplianceConfigurationKeys.NO_PREVIOUS_WATERMARK);
  }
563089
public static File copy(InputStream stream) throws IOException
  {
    File file = createTempFile();
    copy(stream, new FileOutputStream(file));
    return file;
  }
1093186
public static FileUtilLimited getInstance() {

    if (instance == null) {
      synchronized (FileUtilLimitedImpl.class) {
        if (instance == null) {
          FileUtilLimitedImpl util = new FileUtilLimitedImpl();
          util.initialize();
          instance = util;
        }
      }
    }
    return instance;
  }
998214
@Override
    protected void setWatermarks(long nextLowWatermark, long nextHighWatermark)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setWatermarks",
                        new Object[] { new Long(nextLowWatermark), new Long(nextHighWatermark), new Long(referenceStreamCount) });

        super.setWatermarks(nextLowWatermark + referenceStreamCount, nextHighWatermark + referenceStreamCount);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setWatermarks");
    }