public void startupScan(Path directory)
	{
		String status = db.getConfig("startupScan");
		// Check if user disabled the scan
		if(status != null && !status.equals("true"))
		{
			logger.info("Startup scan is disabled.");
			return;
		}

		for(File file : directory.toFile().listFiles())
		{
			if(file.isDirectory())
			{
				// Call itself recursively for directories
				startupScan(directory.resolve(file.toPath()));
			}
			else
			{
				
				// If the file doesn't already exist, we can just copy it over
				if(!FileOp.convertPath(file.toPath()).toFile().exists())
				{
					Path targetDirectory = FileOp.convertPath(file.toPath()).getParent();
					FileOp.copy(file.toPath(), targetDirectory);

					logger.info("Startup: Found new file " + file.toString());
				}
				// The file does exist, so determine if the file has been changed. If it
				// hasn't, we need to create a revision for this file.
				else if(!FileOp.isEqual(file.toPath(), FileOp.convertPath(file.toPath())))
				{
					// Create the diff
					Path diffFile = FileOp.createPatch(FileOp.convertPath(file.toPath()),
							file.toPath());
					// Difference in file sizes
					long delta = FileOp.fileSize(file.toPath())
							- FileOp.fileSize(FileOp.convertPath(file.toPath()));

					// Store the revision
					FileHistory fileHist = new FileHistory(file.toPath());
					fileHist.storeRevision(diffFile, null, FileOp.fileSize(file.toPath()), delta);

					// Finally, copy the file over
					Path targetDirectory = FileOp.convertPath(file.toPath()).getParent();
					FileOp.copy(file.toPath(), targetDirectory);

					logger.info("Startup: Found modified file " + file.toString());
				}
			}
		}
	}