public String sendContentToCMS(String fileDir, String activity, String user, String password, String contentJobType, String contentType, String component,String partitionName) throws MalformedURLException, IOException {
        
        Properties prop = new Properties();
	InputStream inputConfig = null;
 
        inputConfig = new FileInputStream(Constants.CONFIG_FILENAME);
        
        // load a properties file
	prop.load(inputConfig);
        
        String pushReport ="";
        //check for tipp or zip
        String filename = "";
        if (fileDir.contains("/")) {
            //linux filepath
            filename = fileDir.substring(fileDir.lastIndexOf("/"), fileDir.length()).replace("/", "");
            System.out.println(filename);
        } else if (fileDir.contains("\\")) {
            //windows filepath
            filename = fileDir.substring(fileDir.lastIndexOf("\\"), fileDir.length()).replace("\\", "");
            System.out.println(filename);
        }
        
        
        //RepositoryHandler handler = new RepositoryHandler(repositoryURL, repositoryUsername,
          //      repositoryPasword, repositoryType);

        //upload to place holder folder
      //  Folder root = session.getRootFolder();
        Path target = Paths.get(prop.getProperty("globicLocalFolder")+filename);
        URL website = new URL(fileDir);
        Files.copy(website.openStream(), target, StandardCopyOption.REPLACE_EXISTING);
        
        
        //check if file is downloaded
        File f = new File(prop.getProperty("globicLocalFolder")+filename);
	  if(f.exists()){
		  System.out.println("File existed");
	  }else{
                   return "File not downloaded";
	  }
        
        //read content from file
        /*BufferedReader br = null;
        String data = readFile(prop.getProperty("globicLocalFolder")+filename);
      
        //create new file with properties else
        byte[] buf = null;
        try {
            buf = data.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        ByteArrayInputStream input = new ByteArrayInputStream(buf);

        ContentStream cs = session.getObjectFactory().createContentStream(filename, buf.length, "text/xml", input);
        System.out.println("Step 1: Write CMIS properties to the file");
        Map<String, Object> folderProps = new HashMap<String, Object>();
        folderProps.put(PropertyIds.OBJECT_TYPE_ID, "D:loc:doc");
        folderProps.put(PropertyIds.NAME, filename);
        folderProps.put("globic:user", user);
        folderProps.put("globic:password", password);
        folderProps.put("globic:activity", activity);
        folderProps.put("globic:content", contentJobType);
        folderProps.put("globic:contentType", contentType);
        folderProps.put("globic:processed", "no");

        org.apache.chemistry.opencmis.client.api.Document doc;
        try {
            System.out.println("Step 2: Put content in the file and place in the CMS");
            doc = root.createDocument(folderProps, cs, VersioningState.MAJOR);
            doc.updateProperties(folderProps, true);
            System.out.println("File added to alfresco with properties");
        } catch (Exception ex) {

            System.out.println("File exists then just update the content in the file");
            System.out.println("Step 2: Update content in the file");
            data = readFile(filename);
            CmisObject cmisFile = session.getObjectByPath("/" + filename);

            byte[] fileContent = null;
            try {
                fileContent = data.getBytes("UTF-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }

            ByteArrayInputStream filestream = new ByteArrayInputStream(fileContent);

            ContentStream filecontentStream = new ContentStreamImpl(filename, BigInteger.valueOf(data.length()), "text/xml", filestream);
            doc = (Document) cmisFile;
            doc = (Document) session.getObject(doc.checkOut());
            doc.checkIn(false, null, filecontentStream, "just a minor change");
        }

        System.out.println("Step 3: get spaceStore ID");
        String spaceStore = handler.getAlfrescoProperty(filename, "alfcmis:nodeRef");
*/
      //  String contentConsumed = "http://kdeg-vm-13.scss.tcd.ie:8080/alfresco/d/d/workspace/" + spaceStore.replace("workspace://", "") + "/" + filename;
        String contentConsumed="http://kdeg-vm-13.scss.tcd.ie:8080/alfresco/d/d/workspace/" + "/" + filename;
          System.out.println("spaceStore===" + contentConsumed);

        System.out.println("Step 4:Push content to globic using the REST API");
        pushReport = Globic.postGlobicContent(component, user, password, activity, contentConsumed, contentType, contentJobType,prop.getProperty("globicLocalFolder")+filename,partitionName);
        System.out.println(pushReport);
        if (!pushReport.contains("Error")) {
  //          handler.setProperty(filename, user, password, activity, contentJobType, contentType, "yes");
        }
        
        //deletefile
        Files.delete(target);
        
        return pushReport;
    }