Project

General

Profile

« Previous | Next » 

Revision 59094

supporting incremental harvesting with the fs collector plugin

View differences:

FilesystemIterable.java
51 51

  
52 52
	private boolean setObjIdentifierFromFileName = false;
53 53

  
54
	private String fromDate;
55

  
54 56
	/**
55 57
	 * Instantiates a new filesystem iterable.
56 58
	 *
57 59
	 * @param descriptor the descriptor
58 60
	 * @throws CollectorServiceException the collector service exception
59 61
	 */
60
	public FilesystemIterable(final InterfaceDescriptor descriptor) throws CollectorServiceException {
62
	public FilesystemIterable(final InterfaceDescriptor descriptor, final String fromDate) throws CollectorServiceException {
61 63
		try {
62 64
			final String baseUrl = descriptor.getBaseUrl();
63 65
			URL basePath = new URL(baseUrl);
......
71 73
			if (descriptor.getParams().containsKey("setObjIdentifierFromFileName")) {
72 74
				setObjIdentifierFromFileName = Boolean.parseBoolean(descriptor.getParams().get("setObjIdentifierFromFileName"));
73 75
			}
76
			this.fromDate = fromDate;
74 77
		} catch (MalformedURLException e) {
75 78
			throw new CollectorServiceException("Filesystem collector failed! ", e);
76 79
		}
......
83 86
	 */
84 87
	@Override
85 88
	public Iterator<String> iterator() {
86
		final FileSystemIterator fsi = new FileSystemIterator(baseDir.getAbsolutePath(), extensions);
89
		final FileSystemIterator fsi = new FileSystemIterator(baseDir.getAbsolutePath(), extensions, fromDate);
87 90
		return Iterators.transform(fsi, inputFileName -> {
88 91
			FileInputStream fileInputStream = null;
89 92
			try {

Also available in: Unified diff