1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 package convwatch; 29 30 /** 31 * This container class should help to handle the name of the current document 32 */ 33 34 public class NameHelper 35 { 36 /** 37 * 38 */ 39 String m_sOutputPath; 40 41 /** 42 * 43 */ 44 String m_sRelativeOutputPath; 45 46 /** 47 * 48 */ 49 String m_sNameNoSuffix; 50 String m_sSuffix; 51 52 public NameHelper(String _sOutputPath, String _sRelativeOutputPath, String _sBasename) 53 { 54 m_sOutputPath = _sOutputPath; 55 m_sRelativeOutputPath = _sRelativeOutputPath; 56 String sNameNoSuffix = FileHelper.getNameNoSuffix(_sBasename); 57 m_sNameNoSuffix = sNameNoSuffix; 58 m_sSuffix = FileHelper.getSuffix(_sBasename); 59 } 60 /** 61 * @return the OutputPath 62 */ 63 public String getOutputPath() {return m_sOutputPath;} 64 65 /** 66 * @return the relative OutputPath 67 */ 68 public String getRelativePath() {return m_sRelativeOutputPath;} 69 70 /** 71 * @return the document name without it's suffix 72 */ 73 public String getName() {return m_sNameNoSuffix;} 74 75 /** 76 * @return the document suffix from the original document 77 */ 78 public String getSuffix() {return m_sSuffix;} 79 80 public void print() 81 { 82 GlobalLogWriter.get().println(" Outputpath: " + m_sOutputPath); 83 GlobalLogWriter.get().println("relative Outputpath: " + m_sRelativeOutputPath); 84 GlobalLogWriter.get().println(" Name: " + m_sNameNoSuffix); 85 GlobalLogWriter.get().println(" Suffix: " + m_sSuffix); 86 87 } 88 89 } 90