Package org.wso2.carbon.utils

Examples of org.wso2.carbon.utils.ArchiveManipulator.check()


        } catch (IOException e) {
            throw new RuleServiceManagementException("Cannot write facts", e, log);
        }
        ArchiveManipulator archiveManipulator = new ArchiveManipulator();
        try {
            String[] strings = archiveManipulator.check(factFile.getAbsolutePath());
            List<String> list = filterClasses(strings);
            return list.toArray(new String[list.size()]);
        } catch (IOException e) {
            throw new RuleServiceManagementException("Cannot extractPayload classes from the fact" +
                    " file", e, log);
View Full Code Here


                    propertyFile = source.substring(0, source.lastIndexOf(".")) +
                            PROPERTIES_FILE_EXTENSION;
                }
                properties = loadProperties(propertyFile);
                if (properties.size() > 0) {
                    for (String str : am.check(source)) {
                        try {
                            String filePath = dir + File.separator + str;
                            File file = new File(filePath);
                            if (file.isFile()) {
                                List<String> archiveTypes = Arrays.asList("jar", "aar", "war",
View Full Code Here

            String fileName = artifact.getFiles().get(0).getName();
            artifactPath = artifact.getExtractedPath() + File.separator + fileName;
            File artifactInRepo;
            if (new File(artifactPath).exists()) {
                try {
                    String[] filesInZip = archiveManipulator.check(artifactPath);
                    File jsFile = null;
                    for (String file : filesInZip) {
                        String artifactRepoPath = destPath + File.separator + file;
                        if (file.indexOf("/") == -1) {
                            String extension = file.substring(file.indexOf(".") + 1);
View Full Code Here

               }
               String fileName = artifact.getFiles().get(0).getName();
               artifactPath = artifact.getExtractedPath() + File.separator + fileName;
               File artifactInRepo;
               try {
                   String[] filesInZip = archiveManipulator.check(artifactPath);
                   File jsFile = null;
                   for (String file : filesInZip) {
                       String artifactRepoPath = destPath + File.separator + file;
                       if (file.indexOf("/") == -1) {
                           String extension = file.substring(file.indexOf(".") + 1);
View Full Code Here

                    //validating the content of the zip file.
                    File zipFile = ((DeferredFileOutputStream) fileData.getFileItem().
                            getOutputStream()).getFile();
                    fileData.getFileItem().write(zipFile);
                    tempFiles.add(zipFile);
                    String[] files = archiveManipulator.check(zipFile.getAbsolutePath());
                    boolean jsFile = false;
                    boolean resourceFolder = false;
                    //validates the structure of zip file. i.e. zip file shoud contains only one
                    //.js file in the root folder and no other file types, but directories.
                    for (String file : files) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.