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

io.datakernel.remotefs.ForwardingFsClient Maven / Gradle / Ivy

/*
 * Copyright (C) 2015-2019 SoftIndex LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.datakernel.remotefs;

import io.datakernel.bytebuf.ByteBuf;
import io.datakernel.csp.ChannelConsumer;
import io.datakernel.csp.ChannelSupplier;
import io.datakernel.promise.Promise;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;

public abstract class ForwardingFsClient implements FsClient {
	private final FsClient peer;

	public ForwardingFsClient(FsClient peer) {
		this.peer = peer;
	}

	@Override
	public Promise> upload(@NotNull String name, long offset) {
		return peer.upload(name, offset);
	}

	@Override
	public Promise> upload(@NotNull String name) {
		return peer.upload(name);
	}

	@Override
	public Promise> upload(@NotNull String name, long offset, long revision) {
		return peer.upload(name, offset, revision);
	}

	@Override
	public Promise> download(@NotNull String name, long offset, long length) {
		return peer.download(name, offset, length);
	}

	@Override
	public Promise> download(@NotNull String name, long offset) {
		return peer.download(name, offset);
	}

	@Override
	public Promise> download(@NotNull String name) {
		return peer.download(name);
	}

	@Override
	public Promise delete(@NotNull String name) {
		return peer.delete(name);
	}

	@Override
	public Promise delete(@NotNull String name, long revision) {
		return peer.delete(name, revision);
	}

	@Override
	public Promise copy(@NotNull String name, @NotNull String target) {
		return peer.copy(name, target);
	}

	@Override
	public Promise copy(@NotNull String name, @NotNull String target, long targetRevision) {
		return peer.copy(name, target, targetRevision);
	}

	@Override
	public Promise move(@NotNull String name, @NotNull String target) {
		return peer.move(name, target);
	}

	@Override
	public Promise move(@NotNull String filename, @NotNull String target, long targetRevision, long tombstoneRevision) {
		return peer.move(filename, target, targetRevision, tombstoneRevision);
	}

	@Override
	public Promise> listEntities(@NotNull String glob) {
		return peer.listEntities(glob);
	}

	@Override
	public Promise> list(@NotNull String glob) {
		return peer.list(glob);
	}

	@Override
	public Promise<@Nullable FileMetadata> getMetadata(@NotNull String name) {
		return peer.getMetadata(name);
	}

	@Override
	public Promise ping() {
		return peer.ping();
	}

	@Override
	public FsClient transform(@NotNull Function> into, @NotNull Function> from, @NotNull Function> globInto) {
		return peer.transform(into, from, globInto);
	}

	@Override
	public FsClient transform(@NotNull Function> into, @NotNull Function> from) {
		return peer.transform(into, from);
	}

	@Override
	public FsClient addingPrefix(@NotNull String prefix) {
		return peer.addingPrefix(prefix);
	}

	@Override
	public FsClient subfolder(@NotNull String folder) {
		return peer.subfolder(folder);
	}

	@Override
	public FsClient strippingPrefix(@NotNull String prefix) {
		return peer.strippingPrefix(prefix);
	}

	@Override
	public FsClient filter(@NotNull Predicate predicate) {
		return peer.filter(predicate);
	}

	@Override
	public FsClient mount(@NotNull String mountpoint, @NotNull FsClient client) {
		return peer.mount(mountpoint, client);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy