Olá Pessoal,
Fiz da seguinte for e funcionou tando em win como lunix. Se alguem tiver algo melhor ... por favor se pronuncie heheeheh.
public static String getVersao(){
String str = "0";
try {
File catalinaBase = new File( System.getProperty( "catalina.base" ) ).getAbsoluteFile();
BufferedReader in = new BufferedReader(new FileReader(new File( catalinaBase, "webapps/parkingplustickets/META-INF/MANIFEST.MF" )));
while (in.ready()) {
str = in.readLine();
if (str.indexOf("Implementation-Version:") >= 0)
{
Integer Posicao = str.indexOf("-SNAPSHOT");
if (Posicao >= 0){
str = str.substring(25,Posicao);
}else{
str = str.substring(25);
}
in.close();
break;
}
}
} catch (IOException e) {
log.error("Erro ao abrir arquivo " + e.getMessage());
}
return str;
Em Quinta-feira, 24 de Abril de 2014 8:41, José Humberto Fróes Júnior <betofroesjr@gmail.com> escreveu:
Já consegui fazendo assim "/../META-INF/arquivo.mf"
Em 23 de abril de 2014 21:57, Thiago Silva
<thiagocapaverde@yahoo.com.br> escreveu:
Ola pessoal,
estou com uma duvida.
Quero acessar um arquivo que esta dentro do META-INF no tomcat. Qual a posição relativa que deveria colocar?
Coloquei como abaixo mas não fincionou. Se colocar uma posição absoluta como c:\MANIFEST.MF dai funciona.
BufferedReader in = new BufferedReader(new FileReader("META-INF/MANIFEST.MF"));
0 comentários:
Postar um comentário