类java.util.InvalidPropertiesFormatException源码实例Demo

下面列出了怎么用java.util.InvalidPropertiesFormatException的API类实例代码及写法,或者点击链接到github查看源代码。

public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码2 项目: serve   文件: ModelServer.java
public void startAndWait()
        throws InterruptedException, IOException, GeneralSecurityException,
                InvalidSnapshotException {
    try {
        List<ChannelFuture> channelFutures = start();
        // Create and schedule metrics manager
        MetricManager.scheduleMetrics(configManager);
        System.out.println("Model server started."); // NOPMD

        channelFutures.get(0).sync();
    } catch (InvalidPropertiesFormatException e) {
        logger.error("Invalid configuration", e);
    } finally {
        serverGroups.shutdown(true);
        logger.info("Torchserve stopped.");
    }
}
 
源代码3 项目: TencentKona-8   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码4 项目: jdk8u60   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码5 项目: openjdk-jdk8u   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码6 项目: netbeans   文件: ProfilingPointFactory.java
ProfilingPoint[] loadProfilingPoints(Lookup.Provider project)
                              throws IOException, InvalidPropertiesFormatException {
    Properties properties = new Properties();
    ProfilerStorage.loadProjectProperties(properties, project, getProfilingPointsStorage());

    int index = 0;
    List<ProfilingPoint> profilingPoints = new ArrayList();
    while (properties.getProperty(index + "_" + ProfilingPoint.PROPERTY_NAME) != null) { // NOI18N
        ProfilingPoint profilingPoint = loadProfilingPoint(project, properties, index);

        if (profilingPoint != null) {
            profilingPoints.add(profilingPoint);
        } else {
            ErrorManager.getDefault().log(ErrorManager.ERROR, "Invalid " + getType() + // NOI18N
                                         " Profiling Point format at index " + index +  // NOI18N
                                         " in project " + ProjectUtilities.getDisplayName(project)); // NOI18N
        }

        index++;
    }

    return profilingPoints.toArray(new ProfilingPoint[0]);
}
 
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码8 项目: Bytecoder   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码9 项目: openjdk-jdk9   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码10 项目: openjdk-jdk9   文件: LoadAndStoreXML.java
/**
 * Test loadFromXML with malformed documents
 */
static void testLoadWithMalformedDoc(Path dir) throws IOException {
    try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.xml")) {
        for (Path file: stream) {
            System.out.println("testLoadWithMalformedDoc, file=" + file.getFileName());
            try (InputStream in = Files.newInputStream(file)) {
                Properties props = new Properties();
                try {
                    props.loadFromXML(in);
                    throw new RuntimeException("InvalidPropertiesFormatException not thrown");
                } catch (InvalidPropertiesFormatException x) {
                    System.out.println(x);
                }
            }
        }
    }
}
 
源代码11 项目: jdk8u-jdk   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码12 项目: hottub   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码14 项目: openjdk-8   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码15 项目: jdk8u_jdk   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码16 项目: jdk8u-jdk   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码17 项目: jdk8u-dev-jdk   文件: PropertiesDefaultHandler.java
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException, UnsupportedEncodingException
{
    this.properties = props;

    try {
        SAXParser parser = new SAXParserImpl();
        parser.parse(in, this);
    } catch (SAXException saxe) {
        throw new InvalidPropertiesFormatException(saxe);
    }

    /**
     * String xmlVersion = propertiesElement.getAttribute("version"); if
     * (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0) throw new
     * InvalidPropertiesFormatException( "Exported Properties file format
     * version " + xmlVersion + " is not supported. This java installation
     * can read" + " versions " + EXTERNAL_XML_VERSION + " or older. You" +
     * " may need to install a newer version of JDK.");
     */
}
 
源代码18 项目: hop   文件: ConcurrentMapProperties.java
@Override
public synchronized void loadFromXML( InputStream in ) throws IOException, InvalidPropertiesFormatException {
  super.putAll( storageMap );
  super.loadFromXML( in );
  super.forEach( ( key, value ) -> storageMap.putIfAbsent( key, value ) );
  super.clear();
}
 
@Override
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException
{
    PropertiesDefaultHandler handler = new PropertiesDefaultHandler();
    handler.load(props, in);
}
 
源代码20 项目: serve   文件: ConfigManager.java
public void validateConfigurations() throws InvalidPropertiesFormatException {
    String blacklistVars = prop.getProperty(TS_BLACKLIST_ENV_VARS, "");
    try {
        blacklistPattern = Pattern.compile(blacklistVars);
    } catch (PatternSyntaxException e) {
        throw new InvalidPropertiesFormatException(e);
    }
}
 
源代码21 项目: TencentKona-8   文件: BasicXmlPropertiesProvider.java
@Override
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException
{
    PropertiesDefaultHandler handler = new PropertiesDefaultHandler();
    handler.load(props, in);
}
 
源代码22 项目: joyqueue   文件: DefaultNsrServiceProvider.java
@PostConstruct
public void parseBrokers( ) throws InvalidPropertiesFormatException {
    if(servers == null || servers.length == 0) {
        servers = new String[] {"127.0.0.1"};
    }

    for (int i = 0; i < servers.length; i++) {
        servers[i] = servers[i].trim();
        if (!servers[i].matches(PATTERN)) {
            throw new InvalidPropertiesFormatException("Invalid property! joyqueue.servers: " + String.join(",", servers));
        }
    }
    logger.info("Using nameservers: {}.", String.join(",", servers));
}
 
源代码23 项目: jdk8u60   文件: BasicXmlPropertiesProvider.java
@Override
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException
{
    PropertiesDefaultHandler handler = new PropertiesDefaultHandler();
    handler.load(props, in);
}
 
源代码24 项目: stategen   文件: PropertiesHelper.java
public static Properties load(String...files) throws InvalidPropertiesFormatException, IOException {
	Properties properties = new Properties();
	for(String f : files) {
		File file = FileHelper.getFile(f);
		@Cleanup
		InputStream input = new FileInputStream(file);
		if(file.getPath().endsWith(".xml")){
			properties.loadFromXML(input);
		}else {
			properties.load(input);
		}
		properties.putAll(properties);
	}
	return properties;
}
 
源代码25 项目: stategen   文件: PropertiesUtil.java
public static Properties load(String... files) throws InvalidPropertiesFormatException, IOException {
    Properties properties = new Properties();
    for (String f : files) {
        File        file  = new File(f);
        @Cleanup
        InputStream input = new FileInputStream(file);
        if (file.getPath().endsWith(".xml")) {
            properties.loadFromXML(input);
        } else {
            properties.load(input);
        }
        properties.putAll(properties);
    }
    return properties;
}
 
源代码26 项目: stategen   文件: PropertiesHelpers.java
public static Properties load(String... files) throws InvalidPropertiesFormatException, IOException {
    Properties properties = new Properties();
    for (String f : files) {
        File        file  = FileHelpers.getFile(f);
        @Cleanup
        InputStream input = new FileInputStream(file);
        if (file.getPath().endsWith(".xml")) {
            properties.loadFromXML(input);
        } else {
            properties.load(input);
        }
        properties.putAll(properties);
    }
    return properties;
}
 
源代码27 项目: openjdk-jdk8u   文件: BasicXmlPropertiesProvider.java
@Override
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException
{
    PropertiesDefaultHandler handler = new PropertiesDefaultHandler();
    handler.load(props, in);
}
 
源代码28 项目: multi-model-server   文件: ModelServer.java
public void startAndWait() throws InterruptedException, IOException, GeneralSecurityException {
    try {
        List<ChannelFuture> channelFutures = start();
        // Create and schedule metrics manager
        MetricManager.scheduleMetrics(configManager);
        System.out.println("Model server started."); // NOPMD
        channelFutures.get(0).sync();
    } catch (InvalidPropertiesFormatException e) {
        logger.error("Invalid configuration", e);
    } finally {
        serverGroups.shutdown(true);
        logger.info("Model server stopped.");
    }
}
 
源代码29 项目: multi-model-server   文件: ConfigManager.java
public void validateConfigurations() throws InvalidPropertiesFormatException {
    String blacklistVars = prop.getProperty(MMS_BLACKLIST_ENV_VARS, "");
    try {
        blacklistPattern = Pattern.compile(blacklistVars);
    } catch (PatternSyntaxException e) {
        throw new InvalidPropertiesFormatException(e);
    }
}
 
@Override
public void load(Properties props, InputStream in)
    throws IOException, InvalidPropertiesFormatException
{
    PropertiesDefaultHandler handler = new PropertiesDefaultHandler();
    handler.load(props, in);
}
 
 类所在包
 类方法
 同包方法