Line data Source code
1 : // Copyright (C) 2019 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.server.util.git; 16 : 17 : import org.eclipse.jgit.lib.Config; 18 : import org.eclipse.jgit.storage.file.FileBasedConfig; 19 : import org.eclipse.jgit.util.FS; 20 : import org.eclipse.jgit.util.SystemReader; 21 : 22 : public class DelegateSystemReader extends SystemReader { 23 : private final SystemReader delegate; 24 : 25 146 : public DelegateSystemReader(SystemReader delegate) { 26 146 : this.delegate = delegate; 27 146 : } 28 : 29 : @Override 30 : public String getHostname() { 31 139 : return delegate.getHostname(); 32 : } 33 : 34 : @Override 35 : public String getenv(String variable) { 36 139 : return delegate.getenv(variable); 37 : } 38 : 39 : @Override 40 : public String getProperty(String key) { 41 146 : return delegate.getProperty(key); 42 : } 43 : 44 : @Override 45 : public FileBasedConfig openUserConfig(Config parent, FS fs) { 46 16 : return delegate.openUserConfig(parent, fs); 47 : } 48 : 49 : @Override 50 : public FileBasedConfig openSystemConfig(Config parent, FS fs) { 51 0 : return delegate.openSystemConfig(parent, fs); 52 : } 53 : 54 : @Override 55 : public FileBasedConfig openJGitConfig(Config parent, FS fs) { 56 16 : return delegate.openJGitConfig(parent, fs); 57 : } 58 : 59 : @Override 60 : public long getCurrentTime() { 61 138 : return delegate.getCurrentTime(); 62 : } 63 : 64 : @Override 65 : public int getTimezone(long when) { 66 143 : return delegate.getTimezone(when); 67 : } 68 : }