org.mockito.internal.configuration.plugins.PluginFileReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of securemock Show documentation
Show all versions of securemock Show documentation
Libraries for Elasticsearch
The newest version!
/*
* Copyright (c) 2016 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.configuration.plugins;
import org.mockito.internal.util.io.IOUtil;
import java.io.InputStream;
public class PluginFileReader {
public String readPluginClass(InputStream input) {
for(String line: IOUtil.readLines(input)) {
String stripped = stripCommentAndWhitespace(line);
if (stripped.length() > 0) {
return stripped;
}
}
return null;
}
private static String stripCommentAndWhitespace(String line) {
int hash = line.indexOf('#');
if (hash != -1) {
line = line.substring(0, hash);
}
return line.trim();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy