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

de.intarsys.tools.locator.RenamedLocator Maven / Gradle / Ivy

There is a newer version: 4.11
Show newest version
package de.intarsys.tools.locator;

import java.io.IOException;

import de.intarsys.tools.file.FileTools;

public class RenamedLocator extends DelegatingLocator {

	private String name;

	public RenamedLocator(ILocator delegate) {
		super(delegate);
		this.name = delegate.getFullName();
	}

	public RenamedLocator(ILocator delegate, String fullName) {
		super(delegate);
		this.name = fullName;
	}

	@Override
	public String getFullName() {
		return name;
	}

	@Override
	public String getLocalName() {
		return FileTools.getBaseName(name);
	}

	@Override
	public String getTypedName() {
		return FileTools.getFileName(name);
	}

	@Override
	public void rename(String newName) throws IOException {
		this.name = newName;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy