001/* 002 * Copyright (C) 2022 - 2023, the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package io.github.ascopes.jct.filemanagers; 017 018import io.github.ascopes.jct.compilers.JctCompiler; 019import io.github.ascopes.jct.filemanagers.impl.JctFileManagerFactoryImpl; 020import io.github.ascopes.jct.filemanagers.impl.JctFileManagerImpl; 021import io.github.ascopes.jct.utils.UtilityClass; 022import org.apiguardian.api.API; 023import org.apiguardian.api.API.Status; 024 025/** 026 * Helpers to create instances of default implementations for file managers. 027 * 028 * @author Ashley Scopes 029 * @since 1.1.0 030 */ 031@API(since = "1.1.0", status = Status.STABLE) 032public final class JctFileManagers extends UtilityClass { 033 034 private JctFileManagers() { 035 // Static-only class. 036 } 037 038 /** 039 * Create a new default implementation of a file manager. 040 * 041 * @param release the Java release to use for the file manager. 042 * @return the file manager instance. 043 * @deprecated use {@link #newJctFileManagerFactory} instead. 044 */ 045 @Deprecated(forRemoval = true, since = "1.1.3") 046 public static JctFileManager newJctFileManager(String release) { 047 return new JctFileManagerImpl(release); 048 } 049 050 /** 051 * Create a new default implementation of a file manager factory. 052 * 053 * @param compiler the JctCompiler to bind any file managers to. 054 * @return the file manager factory instance. 055 */ 056 public static JctFileManagerFactory newJctFileManagerFactory(JctCompiler compiler) { 057 return new JctFileManagerFactoryImpl(compiler); 058 } 059}