Java tutorial
//package com.java2s; import java.io.File; public class Main { /** * Devuelve el fully qualified name de UseCaseName a partir * del path de una pagina (preferentemente el absoluto) */ public static String getImportUseCaseName(String path) { File arch = new File(path); //legar hasta client: pages=>caso de uso=>useCases=>client File client = arch.getParentFile().getParentFile().getParentFile().getParentFile(); return client.getParentFile().getName() + "." + client.getName() + "." + "UseCaseNames"; } }