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

com.github.robtimus.filesystems.ftp.FTPMessages Maven / Gradle / Ivy

The newest version!
/*
 * FTPMessages.java
 * Copyright 2023 Rob Spoor
 *
 * 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.
 */

// This file has been generated by i18n-maven-plugin
// (https://robtimus.github.io/i18n-maven-plugin/)

package com.github.robtimus.filesystems.ftp;

import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.concurrent.ConcurrentHashMap;

@SuppressWarnings("nls")
final class FTPMessages {

    private static final Map BUNDLES = new ConcurrentHashMap<>();

    private FTPMessages() {
        throw new IllegalStateException("cannot create instances of " + getClass().getName());
    }

    private static ResourceBundle getResourceBundle(Locale locale) {
        Locale l = nonNull(locale);
        return BUNDLES.computeIfAbsent(l, k -> ResourceBundle.getBundle("com.github.robtimus.filesystems.ftp.fs", l));
    }

    private static String getString(Locale locale, String key) {
        ResourceBundle bundle = getResourceBundle(locale);
        return bundle.getString(key);
    }

    private static Locale nonNull(Locale locale) {
        return locale != null ? locale : Locale.getDefault(Locale.Category.FORMAT);
    }

    static String copyOfSymbolicLinksAcrossFileSystemsNotSupported() {
        return copyOfSymbolicLinksAcrossFileSystemsNotSupported(null);
    }

    static String copyOfSymbolicLinksAcrossFileSystemsNotSupported(Locale locale) {
        Locale l = nonNull(locale);
        return getString(l, "copyOfSymbolicLinksAcrossFileSystemsNotSupported");
    }

    static String autoDetectFileStrategyAlreadyInitialized() {
        return autoDetectFileStrategyAlreadyInitialized(null);
    }

    static String autoDetectFileStrategyAlreadyInitialized(Locale locale) {
        Locale l = nonNull(locale);
        return getString(l, "autoDetectFileStrategyAlreadyInitialized");
    }

    static String autoDetectFileStrategyNotInitialized() {
        return autoDetectFileStrategyNotInitialized(null);
    }

    static String autoDetectFileStrategyNotInitialized(Locale locale) {
        Locale l = nonNull(locale);
        return getString(l, "autoDetectFileStrategyNotInitialized");
    }

    static String clientConnectionWaitTimeoutExpired() {
        return clientConnectionWaitTimeoutExpired(null);
    }

    static String clientConnectionWaitTimeoutExpired(Locale locale) {
        Locale l = nonNull(locale);
        return getString(l, "clientConnectionWaitTimeoutExpired");
    }

    static final Log_ log = new Log_();

    static final class Log_ {

        private Log_() {
            super();
        }

        String createdInputStream(Object arg) {
            return createdInputStream(null, arg);
        }

        String createdInputStream(Locale locale, Object arg) {
            Locale l = nonNull(locale);
            String s = getString(l, "log.createdInputStream");
            return String.format(l, s, arg);
        }

        String closedInputStream(Object arg) {
            return closedInputStream(null, arg);
        }

        String closedInputStream(Locale locale, Object arg) {
            Locale l = nonNull(locale);
            String s = getString(l, "log.closedInputStream");
            return String.format(l, s, arg);
        }

        String createdOutputStream(Object arg) {
            return createdOutputStream(null, arg);
        }

        String createdOutputStream(Locale locale, Object arg) {
            Locale l = nonNull(locale);
            String s = getString(l, "log.createdOutputStream");
            return String.format(l, s, arg);
        }

        String closedOutputStream(Object arg) {
            return closedOutputStream(null, arg);
        }

        String closedOutputStream(Locale locale, Object arg) {
            Locale l = nonNull(locale);
            String s = getString(l, "log.closedOutputStream");
            return String.format(l, s, arg);
        }

        String ftpCommandSent(Object arg) {
            return ftpCommandSent(null, arg);
        }

        String ftpCommandSent(Locale locale, Object arg) {
            Locale l = nonNull(locale);
            String s = getString(l, "log.ftpCommandSent");
            return String.format(l, s, arg);
        }

        String ftpReplyReceived(Object arg) {
            return ftpReplyReceived(null, arg);
        }

        String ftpReplyReceived(Locale locale, Object arg) {
            Locale l = nonNull(locale);
            String s = getString(l, "log.ftpReplyReceived");
            return String.format(l, s, arg);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy