one.empty3.feature.SetSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of empty3-library-3d Show documentation
Show all versions of empty3-library-3d Show documentation
3D rendering engine. Plus modeling. Expected glsl textures 3d and 2d rendering
/*
* Copyright (c) 2022-2023. Manuel Daniel Dahmen
*
*
* Copyright 2012-2023 Manuel Daniel Dahmen
*
* 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 one.empty3.feature;
import one.empty3.io.ProcessFile;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import java.io.*;
import java.lang.reflect.Method;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SetSettings {
private String settingsPropertiesPath;
public HashMap processBeans = new HashMap<>();
private String[] currentDirin;
private int maxFilesInDir;
private int maxRes;
private String classnames;
private String classname;
private String currentDirout;
private ProcessFile processInstance;
private FTPClient ftpClient;
private String directory;
private String[] initialDirectories;
public Properties settings() {
Properties p = new Properties();
try {
p.load(
new FileInputStream(settingsPropertiesPath +
"/settings.properties"));
} catch (Exception ex) {
ex.printStackTrace();
}
return p;
}
public void loadArgsProps(String propFile) {
}
public Properties defProcess(
InputStream is) {
Properties p = new Properties();
try {
p.load(is);
} catch (Exception ex) {
ex.printStackTrace();
}
return p;
}
public SetSettings(String settingsFile) {
settingsPropertiesPath = "sets/";
if (settingsFile!=null) {
settingsPropertiesPath =settingsFile;
if (settingsFile.endsWith(".properties")) {
loadArgsProps(settingsFile);
}
if (settingsFile.endsWith(".json")) {
loadArgsJson(settingsFile);
}
} else {
int i = 0;
String[] sets = new File("sets").list();
while (i < Objects.requireNonNull(sets).length) {
settingsPropertiesPath = "sets/" + sets[i];
i++;
}
}
}
public void loadArgsJson(String file) {
}
public void parseAndSet(ProcessFile processInstance, List