Search in sources :

Example 6 with Artifact

use of org.codelibs.fess.helper.PluginHelper.Artifact in project fess by codelibs.

the class PluginHelperTest method test_getArtifactFromFileName2.

public void test_getArtifactFromFileName2() {
    Artifact artifact = pluginHelper.getArtifactFromFileName(ArtifactType.DATA_STORE, "fess-ds-atlassian-13.2.1-20190708.212247-1.jar");
    assertEquals("fess-ds-atlassian", artifact.getName());
    assertEquals("13.2.1-20190708.212247-1", artifact.getVersion());
}
Also used : Artifact(org.codelibs.fess.helper.PluginHelper.Artifact)

Example 7 with Artifact

use of org.codelibs.fess.helper.PluginHelper.Artifact in project fess by codelibs.

the class PluginHelperTest method test_getArtifactFromFileName1.

public void test_getArtifactFromFileName1() {
    Artifact artifact = pluginHelper.getArtifactFromFileName(ArtifactType.DATA_STORE, "fess-ds-atlassian-13.2.0.jar");
    assertEquals("fess-ds-atlassian", artifact.getName());
    assertEquals("13.2.0", artifact.getVersion());
}
Also used : Artifact(org.codelibs.fess.helper.PluginHelper.Artifact)

Example 8 with Artifact

use of org.codelibs.fess.helper.PluginHelper.Artifact in project fess by codelibs.

the class PluginHelperTest method test_getArtifactFromFileName3.

public void test_getArtifactFromFileName3() {
    Artifact artifact = pluginHelper.getArtifactFromFileName(ArtifactType.UNKNOWN, "mysql-connector-java-8.0.17.jar");
    assertEquals("mysql-connector-java", artifact.getName());
    assertEquals("8.0.17", artifact.getVersion());
}
Also used : Artifact(org.codelibs.fess.helper.PluginHelper.Artifact)

Example 9 with Artifact

use of org.codelibs.fess.helper.PluginHelper.Artifact in project fess by codelibs.

the class AdminPluginAction method delete.

@Execute
@Secured({ ROLE })
public HtmlResponse delete(final DeleteForm form) {
    validate(form, messages -> {
    }, () -> asHtml(path_AdminPlugin_AdminPluginJsp));
    verifyToken(() -> asHtml(path_AdminPlugin_AdminPluginJsp));
    final Artifact artifact = new Artifact(form.name, form.version, null);
    deleteArtifact(artifact);
    saveInfo(messages -> messages.addSuccessDeletePlugin(GLOBAL, artifact.getFileName()));
    return redirect(getClass());
}
Also used : Artifact(org.codelibs.fess.helper.PluginHelper.Artifact) Execute(org.lastaflute.web.Execute) Secured(org.codelibs.fess.annotation.Secured)

Aggregations

Artifact (org.codelibs.fess.helper.PluginHelper.Artifact)9 Execute (org.lastaflute.web.Execute)4 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 LogManager (org.apache.logging.log4j.LogManager)2 Logger (org.apache.logging.log4j.Logger)2 Secured (org.codelibs.fess.annotation.Secured)2 AdminPluginAction.deleteArtifact (org.codelibs.fess.app.web.admin.plugin.AdminPluginAction.deleteArtifact)2 AdminPluginAction.installArtifact (org.codelibs.fess.app.web.admin.plugin.AdminPluginAction.installArtifact)2 ApiResult (org.codelibs.fess.app.web.api.ApiResult)2 ArtifactType (org.codelibs.fess.helper.PluginHelper.ArtifactType)2 Response (io.restassured.response.Response)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 FileVisitOption (java.nio.file.FileVisitOption)1 Files (java.nio.file.Files)1