private File getArchetype( String archetypeGroupId, String archetypeArtifactId, String archetypeVersion ) { String key = archetypeGroupId + ":" + archetypeArtifactId + ":" + archetypeVersion; if ( archetypeCache.containsKey( key ) ) { getLogger().debug( "Found archetype " + key + " in cache: " + archetypeCache.get( key ) ); return archetypeCache.get( key ); } getLogger().debug( "Not found archetype " + key + " in cache" ); return null; }
private void closeZipFile( ZipFile zipFile ) { try { zipFile.close(); } catch ( Exception e ) { getLogger().error( "Failed to close " + zipFile.getName() + " zipFile." ); } } }
private ZipEntry searchEntry( ZipFile zipFile, String searchString ) { getLogger().debug( "Searching for " + searchString + " inside " + zipFile.getName() ); Enumeration<? extends ZipEntry> enu = zipFile.entries(); while ( enu.hasMoreElements() ) { ZipEntry entryfound = (ZipEntry) enu.nextElement(); getLogger().debug( " - " + entryfound.getName() ); if ( searchString.equals( entryfound.getName() ) ) { getLogger().debug( "Entry found" ); return entryfound; } } return null; }
public List<String> getFilesetArchetypeResources( File archetypeFile ) throws UnknownArchetype getLogger().debug( "getFilesetArchetypeResources( \"" + archetypeFile.getAbsolutePath() + "\" )" ); List<String> archetypeResources = new ArrayList<String>(); getLogger().debug( " - found resource (" + Constants.ARCHETYPE_RESOURCES + "/)" + resource ); getLogger().debug( " - ignored resource " + entry.getName() );
public boolean isOldArchetype( File archetypeFile ) { ZipFile zipFile = null; try { getLogger().debug( "checking old archetype status on " + archetypeFile ); zipFile = getArchetypeZipFile( archetypeFile ); return isOldArchetype( zipFile ); } catch ( IOException e ) { getLogger().debug( e.toString() ); return false; } catch ( UnknownArchetype e ) { getLogger().debug( e.toString() ); return false; } finally { if ( zipFile != null ) { closeZipFile( zipFile ); } } }
public boolean isFileSetArchetype( File archetypeFile ) { ZipFile zipFile = null; try { getLogger().debug( "checking fileset archetype status on " + archetypeFile ); zipFile = getArchetypeZipFile( archetypeFile ); return isFileSetArchetype( zipFile ); } catch ( IOException e ) { getLogger().debug( e.toString() ); return false; } catch ( UnknownArchetype e ) { getLogger().debug( e.toString() ); return false; } finally { if ( zipFile != null ) { closeZipFile( zipFile ); } } }
public boolean isFileSetArchetype( String groupId, String artifactId, String version, ArtifactRepository archetypeRepository, ArtifactRepository localRepository, List<ArtifactRepository> repositories, ProjectBuildingRequest buildingRequest ) { try { File archetypeFile = getArchetypeFile( groupId, artifactId, version, archetypeRepository, localRepository, repositories, buildingRequest ); return isFileSetArchetype( archetypeFile ); } catch ( UnknownArchetype e ) { getLogger().debug( e.toString() ); return false; } }
public boolean isOldArchetype( String groupId, String artifactId, String version, ArtifactRepository archetypeRepository, ArtifactRepository localRepository, List<ArtifactRepository> repositories, ProjectBuildingRequest buildingRequest ) { try { File archetypeFile = getArchetypeFile( groupId, artifactId, version, archetypeRepository, localRepository, repositories, buildingRequest ); return isOldArchetype( archetypeFile ); } catch ( UnknownArchetype e ) { getLogger().debug( e.toString() ); return false; } }