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

io.activej.fs.ForwardingActiveFs Maven / Gradle / Ivy

Go to download

Provides tools for building efficient, scalable local, remote or clustered file servers. It utilizes ActiveJ CSP for fast and reliable file transfer.

There is a newer version: 6.0-beta2
Show newest version
/*
 * Copyright (C) 2020 ActiveJ 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.activej.fs;

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

import java.util.Map;
import java.util.Set;

/**
 * An implementation of {@link ActiveFs} that forwards all the calls to the underlying {@link ActiveFs}.
 * May be suitable for creating decorators that override certain behaviour of file system.
 * 

* Inherits all the limitations of underlying {@link ActiveFs} */ public abstract class ForwardingActiveFs implements ActiveFs { private final ActiveFs peer; protected ForwardingActiveFs(ActiveFs peer) { this.peer = peer; } @Override public Promise> upload(@NotNull String name) { return peer.upload(name); } @Override public Promise> upload(@NotNull String name, long size) { return peer.upload(name, size); } @Override public Promise> append(@NotNull String name, long offset) { return peer.append(name, offset); } @Override public Promise> download(@NotNull String name, long offset, long limit) { return peer.download(name, offset, limit); } @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 deleteAll(Set toDelete) { return peer.deleteAll(toDelete); } @Override public Promise copy(@NotNull String name, @NotNull String target) { return peer.copy(name, target); } @Override public Promise copyAll(Map sourceToTarget) { return peer.copyAll(sourceToTarget); } @Override public Promise move(@NotNull String name, @NotNull String target) { return peer.move(name, target); } @Override public Promise moveAll(Map sourceToTarget) { return peer.moveAll(sourceToTarget); } @Override public Promise> list(@NotNull String glob) { return peer.list(glob); } @Override public Promise<@Nullable FileMetadata> info(@NotNull String name) { return peer.info(name); } @Override public Promise> infoAll(@NotNull Set names) { return peer.infoAll(names); } @Override public Promise ping() { return peer.ping(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy