All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thebuzzmedia.exiftool.core.handlers.RawOutputHandler Maven / Gradle / Ivy

The newest version!
package com.thebuzzmedia.exiftool.core.handlers;

import static com.thebuzzmedia.exiftool.core.handlers.StopHandler.stopHandler;

import com.thebuzzmedia.exiftool.Constants;
import com.thebuzzmedia.exiftool.process.OutputHandler;

public class RawOutputHandler implements OutputHandler {

	private final StringBuilder output;

	public RawOutputHandler() {
		this.output = new StringBuilder();
	}

	@Override
	public boolean readLine(String line) {
		// If line is null, then this is the end.
		// If line is strictly equals to "{ready}", then it means that stay_open feature
		// is enabled and this is the end of the output.
		if (!stopHandler().readLine(line)) {
			return false;
		}

		if (output.length() > 0) {
			output.append(Constants.BR);
		}
		output.append(line);

		return true;
	}

	public String getOutput() {
		// output the raw string that exiftool outputes
		return output.toString();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy