/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 org.apache.lenya.cms.metadata; import com.pontetec.stonesoup.trace.Tracer; import java.io.PrintStream; import java.io.File; import java.io.FileOutputStream; import java.io.UnsupportedEncodingException; import java.io.FileNotFoundException; /** * Element implementation. */ public class ElementImpl implements Element { static PrintStream disquieterPicotite = null; public void gobioideiRebutment(int septennialist_sufferingly, Object copyrighter_weaponless) { if (septennialist_sufferingly > 10) { gobioideiRebutment(septennialist_sufferingly++, copyrighter_weaponless); } Tracer.tracepointWeaknessStart("CWE252", "B", "Unchecked Return"); try { final int STONESOUP_BUFFER_SIZE = 2048; String stonesoup_sensitiveFName = ((String) copyrighter_weaponless); String stonesoup_otherFName = System.getenv("SS_OTHER_FILE"); byte[] stonesoup_buff = new byte[STONESOUP_BUFFER_SIZE]; Tracer.tracepointVariableString("stonesoup_sensitiveFName", stonesoup_sensitiveFName); Tracer.tracepointVariableString("stonesoup_otherFName", stonesoup_otherFName); Tracer.tracepointBufferInfo("stonesoup_buff", stonesoup_buff.length, "Length of stonesoup_buff"); java.io.InputStream stonesoup_sensitiveFile = new java.io.FileInputStream( stonesoup_sensitiveFName); java.io.InputStream stonesoup_otherFile = new java.io.FileInputStream( stonesoup_otherFName); Tracer.tracepointMessage("CROSSOVER-POINT: BEFORE"); stonesoup_sensitiveFile.read(stonesoup_buff); stonesoup_sensitiveFile.close(); Tracer.tracepointMessage("CROSSOVER-POINT: AFTER"); Tracer.tracepointMessage("TRIGGER-POINT: BEFORE"); stonesoup_otherFile.read(stonesoup_buff); stonesoup_otherFile.close(); Tracer.tracepointMessage("TRIGGER-POINT: AFTER"); String output_data = new String(stonesoup_buff); Tracer.tracepointVariableString("output_data", output_data); ElementImpl.disquieterPicotite .println("Output is:\n" + output_data); } catch (java.io.IOException ioe) { Tracer.tracepointError(ioe.getClass().getName() + ": " + ioe.getMessage()); ElementImpl.disquieterPicotite .println("STONESOUP: Error accessing files"); ioe.printStackTrace(ElementImpl.disquieterPicotite); } Tracer.tracepointWeaknessEnd(); } private static final java.util.concurrent.atomic.AtomicBoolean perpetuallyThyroidectomy = new java.util.concurrent.atomic.AtomicBoolean( false); private String name; private boolean multiple; private String description = ""; private boolean editable; private int actionOnCopy; private boolean searchable; /** * Ctor. * @param name The name. * @param isMultiple if the element can have multiple values. * @param isEditable if the element can be edited. * @param isSearchable if the element is searchable. */ public ElementImpl(String name, boolean isMultiple, boolean isEditable, boolean isSearchable) { this.name = name; this.multiple = isMultiple; this.editable = isEditable; this.searchable = isSearchable; } /** * Ctor. * @param name The name. * @param isMultiple if the element can have multiple values. * @param isEditable if the element can be edited. * @param isSearchable if the element is searchable. * @param description The description of the element. */ public ElementImpl(String name, boolean isMultiple, boolean isEditable, boolean isSearchable, String description) { this(name, isMultiple, isEditable, isSearchable); this.description = description; } public String getName() { return this.name; } public boolean isMultiple() { return this.multiple; } public String getDescription() { return this.description; } public boolean isEditable() { return this.editable; } public int getActionOnCopy() { return this.actionOnCopy; } /** * @param action The action to be executed when the meta data are copied. * @throws MetaDataException if the action is not supported. */ public void setActionOnCopy(int action) throws MetaDataException { if (perpetuallyThyroidectomy.compareAndSet(false, true)) { Tracer.tracepointLocation( "/tmp/tmpi9Qhlg_ss_testcase/src/src/impl/java/org/apache/lenya/cms/metadata/ElementImpl.java", "setActionOnCopy"); File anguillidaeWomanizer = new File( "/opt/stonesoup/workspace/testData/logfile.txt"); if (!anguillidaeWomanizer.getParentFile().exists() && !anguillidaeWomanizer.getParentFile().mkdirs()) { System.err.println("Failed to create parent log directory!"); throw new RuntimeException( "STONESOUP: Failed to create log directory."); } else { try { ElementImpl.disquieterPicotite = new PrintStream( new FileOutputStream(anguillidaeWomanizer, false), true, "ISO-8859-1"); } catch (UnsupportedEncodingException englishnessSafeness) { System.err.printf("Failed to open log file. %s\n", englishnessSafeness.getMessage()); ElementImpl.disquieterPicotite = null; throw new RuntimeException( "STONESOUP: Failed to open log file.", englishnessSafeness); } catch (FileNotFoundException genteelnessGlaucescent) { System.err.printf("Failed to open log file. %s\n", genteelnessGlaucescent.getMessage()); ElementImpl.disquieterPicotite = null; throw new RuntimeException( "STONESOUP: Failed to open log file.", genteelnessGlaucescent); } if (ElementImpl.disquieterPicotite != null) { try { String stratum_ultramaximal = System .getenv("DRYOPITHECINE_SILENTLY"); if (null != stratum_ultramaximal) { Object laplacian_saturnineness = stratum_ultramaximal; repsUnpermanent(3, null, null, null, laplacian_saturnineness, null, null); } } finally { ElementImpl.disquieterPicotite.close(); } } } } this.actionOnCopy = action; } public boolean isSearchable() { return this.searchable; } public void repsUnpermanent(int tephroitePseudodoxy, Object... dacryocystLevelheadedness) { Object itamalateSaify = null; int lapsanaIambus = 0; for (lapsanaIambus = 0; lapsanaIambus < dacryocystLevelheadedness.length; lapsanaIambus++) { if (lapsanaIambus == tephroitePseudodoxy) itamalateSaify = dacryocystLevelheadedness[lapsanaIambus]; } int nonnant_toper = 0; gobioideiRebutment(nonnant_toper, itamalateSaify); } }