/** * Ensures that the File associated with this stub (if any) is in a writable location * * @param stub */ protected <T> void validateOutputPath(final Stub<T> stub) { if (stub.getOutputFile() != null && !(IOUtils.isSpecialFile(stub.getOutputFile()))) { final File parentDir = stub.getOutputFile().getAbsoluteFile().getParentFile(); if (!(parentDir.canWrite() && parentDir.canExecute())) throw new UserException.CouldNotCreateOutputFile( stub.getOutputFile(), "either the containing directory doesn't exist or it isn't writable"); } }