1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package convwatch; 25 26 /** 27 * This container class should help to handle the name of the current document 28 */ 29 30 public class NameHelper 31 { 32 /** 33 * 34 */ 35 String m_sOutputPath; 36 37 /** 38 * 39 */ 40 String m_sRelativeOutputPath; 41 42 /** 43 * 44 */ 45 String m_sNameNoSuffix; 46 String m_sSuffix; 47 NameHelper(String _sOutputPath, String _sRelativeOutputPath, String _sBasename)48 public NameHelper(String _sOutputPath, String _sRelativeOutputPath, String _sBasename) 49 { 50 m_sOutputPath = _sOutputPath; 51 m_sRelativeOutputPath = _sRelativeOutputPath; 52 String sNameNoSuffix = FileHelper.getNameNoSuffix(_sBasename); 53 m_sNameNoSuffix = sNameNoSuffix; 54 m_sSuffix = FileHelper.getSuffix(_sBasename); 55 } 56 /** 57 * @return the OutputPath 58 */ getOutputPath()59 public String getOutputPath() {return m_sOutputPath;} 60 61 /** 62 * @return the relative OutputPath 63 */ getRelativePath()64 public String getRelativePath() {return m_sRelativeOutputPath;} 65 66 /** 67 * @return the document name without it's suffix 68 */ getName()69 public String getName() {return m_sNameNoSuffix;} 70 71 /** 72 * @return the document suffix from the original document 73 */ getSuffix()74 public String getSuffix() {return m_sSuffix;} 75 print()76 public void print() 77 { 78 GlobalLogWriter.get().println(" Outputpath: " + m_sOutputPath); 79 GlobalLogWriter.get().println("relative Outputpath: " + m_sRelativeOutputPath); 80 GlobalLogWriter.get().println(" Name: " + m_sNameNoSuffix); 81 GlobalLogWriter.get().println(" Suffix: " + m_sSuffix); 82 83 } 84 85 } 86