File: FileScanner.java

package info (click to toggle)
gpsprune 26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,824 kB
  • sloc: java: 52,154; sh: 25; makefile: 21; python: 15
file content (30 lines) | stat: -rw-r--r-- 999 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package tim.prune.function.filesleuth;

import java.util.TimeZone;

import tim.prune.function.filesleuth.data.TrackContents;
import tim.prune.function.filesleuth.data.TrackFile;
import tim.prune.function.filesleuth.extract.ContentExtractor;
import tim.prune.function.filesleuth.extract.ExtractorFactory;


/** Responsible for using a ContentExtractor to get the contents of a single file */
public class FileScanner extends AbstractFileScanner
{
	public FileScanner(TrackFile inFile, WorkerCoordinator inCoordinator, TimeZone inTimezone) {
		super(inFile, inCoordinator, inTimezone);
	}

	@Override
	protected void run()
	{
		ContentExtractor extractor = ExtractorFactory.createExtractor(getFile());
		TrackContents contents = (extractor == null ? new TrackContents(_timezone) : extractor.getContents(_timezone));
		// Wait a little to avoid overloading everything
		try {
			Thread.sleep(100L);
		}
		catch (InterruptedException ignored) {}
		finished(contents);
	}
}