diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java index fd2bf5cac6..4b2caff3f1 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java @@ -19,8 +19,6 @@ package org.apache.ofbiz.base.util; import java.io.BufferedInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.Serializable; @@ -486,85 +484,6 @@ public final class UtilProperties implements Serializable { return value == null ? "" : value.trim(); } - /** Sets the specified value of the specified property name to the specified resource/properties file - * @param resource The name of the resource - must be a file - * @param name The name of the property in the properties file - * @param value The value of the property in the properties file */ - public static void setPropertyValue(String resource, String name, String value) { - if (UtilValidate.isEmpty(resource)) { - return; - } - if (UtilValidate.isEmpty(name)) { - return; - } - - Properties properties = getProperties(resource); - if (properties == null) { - return; - } - - try ( - FileOutputStream propFile = new FileOutputStream(resource);) { - properties.setProperty(name, value); - if ("XuiLabels".equals(name)) { - properties.store(propFile, - "##############################################################################\n" - +"# Licensed to the Apache Software Foundation (ASF) under one \n" - +"# or more contributor license agreements. See the NOTICE file \n" - +"# distributed with this work for additional information \n" - +"# regarding copyright ownership. The ASF licenses this file \n" - +"# to you under the Apache License, Version 2.0 (the \n" - +"# \"License\"); you may not use this file except in compliance \n" - +"# with the License. You may obtain a copy of the License at \n" - +"# \n" - +"# http://www.apache.org/licenses/LICENSE-2.0 \n" - +"# \n" - +"# Unless required by applicable law or agreed to in writing, \n" - +"# software distributed under the License is distributed on an \n" - +"# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY \n" - +"# KIND, either express or implied. See the License for the \n" - +"# specific language governing permissions and limitations \n" - +"# under the License. \n" - +"###############################################################################\n" - +"# \n" - +"# Dynamically modified by OFBiz Framework (org.apache.ofbiz.base.util : UtilProperties.setPropertyValue)\n" - +"# \n" - +"# By default the screen is 1024x768 wide. If you want to use another screen size,\n" - +"# you must create a new directory under plugins/pos/screens, like the 800x600.\n" - +"# You must also set the 3 related parameters (StartClass, ClientWidth, ClientHeight) accordingly.\n" - +"#"); - } else { - properties.store(propFile, - "##############################################################################\n" - +"# Licensed to the Apache Software Foundation (ASF) under one \n" - +"# or more contributor license agreements. See the NOTICE file \n" - +"# distributed with this work for additional information \n" - +"# regarding copyright ownership. The ASF licenses this file \n" - +"# to you under the Apache License, Version 2.0 (the \n" - +"# \"License\"); you may not use this file except in compliance \n" - +"# with the License. You may obtain a copy of the License at \n" - +"# \n" - +"# http://www.apache.org/licenses/LICENSE-2.0 \n" - +"# \n" - +"# Unless required by applicable law or agreed to in writing, \n" - +"# software distributed under the License is distributed on an \n" - +"# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY \n" - +"# KIND, either express or implied. See the License for the \n" - +"# specific language governing permissions and limitations \n" - +"# under the License. \n" - +"###############################################################################\n" - +"# \n" - +"# Dynamically modified by OFBiz Framework (org.apache.ofbiz.base.util : UtilProperties.setPropertyValue)\n" - +"# The comments have been removed, you may still find them on the OFBiz repository... \n" - +"#"); - } - } catch (FileNotFoundException e) { - Debug.logInfo(e, "Unable to located the resource file.", module); - } catch (IOException e) { - Debug.logError(e, module); - } - } - /** Sets the specified value of the specified property name to the specified resource/properties in memory, does not persist it * @param resource The name of the resource * @param name The name of the property in the resource diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java index 6d966816a4..f26f0064c6 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java @@ -246,13 +246,9 @@ public final class EntityUtilProperties implements Serializable { return UtilProperties.getSplitPropertyValue(url, name); } - public static void setPropertyValue(String resource, String name, String value) { - UtilProperties.setPropertyValue(resource, name, value); - } - - public static void setPropertyValueInMemory(String resource, String name, String value) { - UtilProperties.setPropertyValueInMemory(resource, name, value); - } + public static void setPropertyValueInMemory(String resource, String name, String value) { + UtilProperties.setPropertyValueInMemory(resource, name, value); + } public static String setPropertyValue(Delegator delegator, String resourceName, String name, String value) { GenericValue gv = null;