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

com.redis.riot.file.FilenameInputStreamResource Maven / Gradle / Ivy

There is a newer version: 4.1.9
Show newest version
package com.redis.riot.file;

import java.io.InputStream;
import java.util.Objects;

import org.springframework.core.io.InputStreamResource;

import com.redis.riot.file.FilenameInputStreamResource;

public class FilenameInputStreamResource extends InputStreamResource {

	private final String filename;

	public FilenameInputStreamResource(InputStream inputStream, String filename, String description) {
		super(inputStream, description);
		this.filename = filename;
	}

	@Override
	public String getFilename() {
		return filename;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + Objects.hash(filename);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		FilenameInputStreamResource other = (FilenameInputStreamResource) obj;
		return Objects.equals(filename, other.filename);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy