LibreOffice Module xmerge (master)  1
ConverterInfoList.java
Go to the documentation of this file.
1 /*
2  * This file is part of the LibreOffice project.
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  *
8  * This file incorporates work covered by the following license notice:
9  *
10  * Licensed to the Apache Software Foundation (ASF) under one or more
11  * contributor license agreements. See the NOTICE file distributed
12  * with this work for additional information regarding copyright
13  * ownership. The ASF licenses this file to you under the Apache
14  * License, Version 2.0 (the "License"); you may not use this file
15  * except in compliance with the License. You may obtain a copy of
16  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
17  */
18 
19 package org.openoffice.xmerge.test;
20 
21 import java.io.BufferedInputStream;
22 import java.io.IOException;
23 import java.io.InputStream;
24 import java.util.ArrayList;
25 import java.util.Iterator;
26 import java.util.Properties;
27 
32 public class ConverterInfoList {
33 
34  private static String defaultPropsFile = "ConverterInfoList.properties";
35  private ArrayList<String> jars;
36 
45  public ConverterInfoList() throws IOException {
46  this(defaultPropsFile);
47  }
48 
56  public ConverterInfoList(String propsFile) throws IOException {
57 
58  Class<? extends ConverterInfoList> c = this.getClass();
59  InputStream is = c.getResourceAsStream(propsFile);
60  BufferedInputStream bis = new BufferedInputStream(is);
61  Properties props = new Properties();
62  try {
63  props.load(bis);
64  } finally {
65  bis.close();
66  }
67 
68  int i = 1;
69  String jarFileName = "";
70  jars = new ArrayList<String>();
71 
72  while ((jarFileName = props.getProperty("jarname" + i)) != null) {
73  jars.add(jarFileName);
74  i++;
75  }
76  }
77 
87  public Iterator<String> getJarFileEnum() {
88 
89  return jars.iterator();
90  }
91 }
ConverterInfoList()
This constructor loads and reads the default properties file.
exports com.sun.star. java
int i
PyRef getClass(const OUString &name, const Runtime &runtime)
dictionary props
Iterator< String > getJarFileEnum()
Returns an.
ConverterInfoList(String propsFile)
This constructor loads and reads the properties file.
Loads a properties file so that registry knows which plug-ins it needs to load.