@Override public void deleteEntity(JavaType entity) { final String entityFilePathIdentifier = getPathResolver().getCanonicalPath(entity.getModule(), Path.SRC_MAIN_JAVA, entity); if (getFileManager().exists(entityFilePathIdentifier)) { getFileManager().delete(entityFilePathIdentifier); } }
fileManager.delete(fileEvent.getFileDetails().getCanonicalPath(), fileEvent .getFileDetails().getFile().getName() + " not found"); final String itdCanonicalPath = itd.getCanonicalPath(); if (fileManager.exists(itdCanonicalPath)) { fileManager.delete(itdCanonicalPath, fileEvent.getFileDetails().getFile().getName() + " not found");
/** * Deletes the given ITD, either now or later. * * @param metadataIdentificationString the ITD's metadata ID * @param itdFilename the ITD's filename * @param reason the reason for deletion; ignored if now is * <code>false</code> * @param now whether to delete the ITD immediately; <code>false</code> * schedules it for later deletion; this is preferable when it's * possible that the ITD might need to be re-created in the * meantime (e.g. because some ancestor metadata has changed to * that effect), otherwise there will be spurious console * messages about the ITD being deleted and created */ private void deleteItd(final String metadataIdentificationString, final String itdFilename, final String reason, final boolean now) { if (now) { getFileManager().delete(itdFilename, reason); } else { getFileManager().createOrUpdateTextFileIfRequired(itdFilename, "", false); } getItdDiscoveryService().removeItdTypeDetails(metadataIdentificationString); // TODO do we need to notify downstream dependencies that this ITD has // gone away? }
endpointService); if (getFileManager().exists(serviceFilePathIdentifier) && force) { getFileManager().delete(serviceFilePathIdentifier); } else if (getFileManager().exists(serviceFilePathIdentifier)) { throw new IllegalArgumentException(String.format(
pathResolver.getCanonicalPath(name.getModule(), Path.SRC_MAIN_JAVA, name); if (fileManager.exists(entityFilePathIdentifier) && shellContext.isForce()) { fileManager.delete(entityFilePathIdentifier); } else if (fileManager.exists(entityFilePathIdentifier) && !shellContext.isForce()) { throw new IllegalArgumentException(
fileManager.delete(entityFilePathIdentifier); } else if (fileManager.exists(entityFilePathIdentifier) && !shellContext.isForce()) { throw new IllegalArgumentException(
pathResolver.getCanonicalPath(name.getModule(), Path.SRC_MAIN_JAVA, name); if (fileManager.exists(entityFilePathIdentifier) && shellContext.isForce()) { fileManager.delete(entityFilePathIdentifier); } else if (fileManager.exists(entityFilePathIdentifier) && !shellContext.isForce()) { throw new IllegalArgumentException(
/** * Removes Exception view .jspx. * * @param exceptionViewName Exception Name to remove. */ private void removeExceptionView(String exceptionViewName) { String exceptionFilename = pathResolver.getIdentifier( LogicalPath.getInstance(Path.SRC_MAIN_WEBAPP, ""), "WEB-INF/views/" + exceptionViewName + JSPX_EXTENSION); fileManager.delete(exceptionFilename); }
/** * {@inheritDoc} * <p> * First, deletes the old class using its Id and then creates the new one * with the updated values in file system. * </p> */ public void updateClass( ClassOrInterfaceTypeDetails classOrInterfaceTypeDetails) { // TODO: Comprobar si ha variado el contenido para no hacer operaciones // innecesarias. // TODO: 'ClassOrInterfaceDeclaration' mantiene el javaDoc. String javaIdentifier = typeLocationService .getPhysicalTypeIdentifier(classOrInterfaceTypeDetails .getName()); javaIdentifier = javaIdentifier.substring( javaIdentifier.indexOf("?") + 1).replaceAll("\\.", "/"); fileManager.delete(projectOperations.getPathResolver().getIdentifier( LogicalPath.getInstance(Path.SRC_MAIN_JAVA, ""), javaIdentifier.concat(".java"))); typeManagementService .createOrUpdateTypeOnDisk(classOrInterfaceTypeDetails); }
/** * Deletes the given {@link JavaType} for the given reason * * @param javaType the type to be deleted (required) * @param reason the reason for deletion (can be blank) */ private void deleteJavaType(final JavaType javaType, final String reason) { final PhysicalTypeMetadata governorPhysicalTypeMetadata = getPhysicalTypeMetadata(javaType); if (governorPhysicalTypeMetadata != null) { final String filePath = governorPhysicalTypeMetadata .getPhysicalLocationCanonicalPath(); if (fileManager.exists(filePath)) { fileManager.delete(filePath, reason); shell.flash(Level.FINE, "Deleted " + javaType.getFullyQualifiedTypeName(), DbreDatabaseListenerImpl.class.getName()); } shell.flash(Level.FINE, "", DbreDatabaseListenerImpl.class.getName()); } }
@Override public void deleteEntity(JavaType entity) { final String entityFilePathIdentifier = getPathResolver().getCanonicalPath(entity.getModule(), Path.SRC_MAIN_JAVA, entity); if (getFileManager().exists(entityFilePathIdentifier)) { getFileManager().delete(entityFilePathIdentifier); } }
fileManager.delete(fileEvent.getFileDetails().getCanonicalPath(), fileEvent .getFileDetails().getFile().getName() + " not found"); final String itdCanonicalPath = itd.getCanonicalPath(); if (fileManager.exists(itdCanonicalPath)) { fileManager.delete(itdCanonicalPath, fileEvent.getFileDetails().getFile().getName() + " not found");
/** * Deletes the given ITD, either now or later. * * @param metadataIdentificationString the ITD's metadata ID * @param itdFilename the ITD's filename * @param reason the reason for deletion; ignored if now is * <code>false</code> * @param now whether to delete the ITD immediately; <code>false</code> * schedules it for later deletion; this is preferable when it's * possible that the ITD might need to be re-created in the * meantime (e.g. because some ancestor metadata has changed to * that effect), otherwise there will be spurious console * messages about the ITD being deleted and created */ private void deleteItd(final String metadataIdentificationString, final String itdFilename, final String reason, final boolean now) { if (now) { getFileManager().delete(itdFilename, reason); } else { getFileManager().createOrUpdateTextFileIfRequired(itdFilename, "", false); } getItdDiscoveryService().removeItdTypeDetails(metadataIdentificationString); // TODO do we need to notify downstream dependencies that this ITD has // gone away? }
pathResolver.getCanonicalPath(name.getModule(), Path.SRC_MAIN_JAVA, name); if (fileManager.exists(entityFilePathIdentifier) && shellContext.isForce()) { fileManager.delete(entityFilePathIdentifier); } else if (fileManager.exists(entityFilePathIdentifier) && !shellContext.isForce()) { throw new IllegalArgumentException(
pathResolver.getCanonicalPath(name.getModule(), Path.SRC_MAIN_JAVA, name); if (fileManager.exists(entityFilePathIdentifier) && shellContext.isForce()) { fileManager.delete(entityFilePathIdentifier); } else if (fileManager.exists(entityFilePathIdentifier) && !shellContext.isForce()) { throw new IllegalArgumentException(
fileManager.delete(entityFilePathIdentifier); } else if (fileManager.exists(entityFilePathIdentifier) && !shellContext.isForce()) { throw new IllegalArgumentException(