Java Code Examples for org.wso2.carbon.integration.common.utils.FileManager#deleteFile()

The following examples show how to use org.wso2.carbon.integration.common.utils.FileManager#deleteFile() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ServerConfigurationManager.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
/**
 * @param fileName file name
 * @throws IOException
 * @throws URISyntaxException
 */
public void removeFromComponentLib(String fileName) throws IOException, URISyntaxException {
    String carbonHome = System.getProperty(ServerConstants.CARBON_HOME);
    String filePath = Paths.get(carbonHome, "lib", fileName).toString();
    FileManager.deleteFile(filePath);
    //      removing osgi bundle from dropins; OSGI bundle versioning starts with _1.0.0
    fileName = fileName.replace("-", "_");
    fileName = fileName.replace(".jar", "_1.0.0.jar");
    removeFromComponentDropins(fileName);
}
 
Example 2
Source File: ServerConfigurationManager.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
/**
 * @param fileName file name
 * @throws IOException
 * @throws URISyntaxException
 */
public void removeFromComponentDropins(String fileName) throws IOException, URISyntaxException {
    String carbonHome = System.getProperty(ServerConstants.CARBON_HOME);
    URI filePath = Paths.get(carbonHome, "dropins", fileName).toUri();
    File file = Paths.get(filePath).toFile();

    if (file.exists()) {
        FileManager.deleteFile(file.getAbsolutePath());
    }
}
 
Example 3
Source File: SynapseArtifactsHotDeploymentTestCase.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
private Callable<Boolean> fileDelete(final String filePath) {
    return new Callable<Boolean>() {
        public Boolean call() throws Exception {
            return FileManager.deleteFile(filePath);
        }
    };
}
 
Example 4
Source File: ServerConfigurationManager.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
     * @param fileName file name
     * @throws IOException
     * @throws URISyntaxException
     */
    public void removeFromComponentLib(String fileName) throws IOException, URISyntaxException {
        String carbonHome = System.getProperty(ServerConstants.CARBON_HOME);
        String filePath = Paths.get(carbonHome ,"lib" , fileName).toString();
        FileManager.deleteFile(filePath);
//      removing osgi bundle from dropins; OSGI bundle versioning starts with _1.0.0
        fileName = fileName.replace("-", "_");
        fileName = fileName.replace(".jar", "_1.0.0.jar");
        removeFromComponentDropins(fileName);
    }
 
Example 5
Source File: ServerConfigurationManager.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * @param fileName file name
 * @throws IOException
 * @throws URISyntaxException
 */
public void removeFromComponentDropins(String fileName) throws IOException, URISyntaxException {
    String carbonHome = System.getProperty(ServerConstants.CARBON_HOME);
    URI filePath = Paths.get(carbonHome, "dropins", fileName).toUri();
    File file = Paths.get(filePath).toFile();

    if (file.exists()) {
        FileManager.deleteFile(file.getAbsolutePath());
    }
}
 
Example 6
Source File: SynapseArtifactsHotDeploymentTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
private Callable<Boolean> fileDelete(final String filePath) {
    return new Callable<Boolean>() {
        public Boolean call() throws Exception {
            return FileManager.deleteFile(filePath);
        }
    };
}
 
Example 7
Source File: RestResourceLCWithTwoActionsPointingToSameStateWithExecutor.java    From product-es with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void cleanUp() throws Exception {
    deleteAsset(assetId, publisherUrl, cookieHeader, "restservice", genericRestClient);
    lifeCycleAdminServiceClient.editLifeCycle(lifeCycleName,
                                              readFile(resourcePath + "lifecycle" +
                                                       File.separator + "ServiceLifeCycle.xml"));
    FileManager.deleteFile(libPath + File.separator + executorJAR);
    FileManager.deleteFile(dropinsPath + File.separator + "test_artifacts_1.0_SNAPSHOT_1.0.0.jar");
    serverConfigurationManager.restartGracefully();
}