code: public boolean createArchive(String sourcePath, String targetPath) {
  
          try {
  
              // make sure we're working with absolute canonical paths
              File source = new File(sourcePath).getCanonicalFile();
  
              // check for the existence of source
              if (!FileUtils.fileExists(source)) {
                  return false;
              }
  
              File target = new File(targetPath).getCanonicalFile();
  
              // determine parent of source path
              _parentOfOriginalSourcePath = source.getParent();
  
              if (_parentOfOriginalSourcePath.endsWith(File.separator)) {
  
                  // parent of source path is the root - so we need to truncate the trailing slash
                  // for (later) relative path construction.
                  _parentOfOriginalSourcePath = _parentOfOriginalSourcePath.substring(0, _parentOfOriginalSourcePath.length() - 1);
              }
  
              // make sure parent dir of target archive exists
              FileUtils.fileMkDirs(target.getParentFile());
  
              // if target already exists, we'll just overwrite
              createNewFile(target);
  
              // Create the ZIP file
              ZipOutputStream out = new ZipOutputStream(getOutputStream(target));
  
              if (FileUtils.fileIsFile(source)) {
  
                  archiveFile(source, out);
  
              } else if (FileUtils.fileIsDirectory(source)) {
  
                  archiveDirectory(source, out);
              }
  
              // Complete the ZIP file
              out.close();
  
          } catch (Exception e) {
  
              FFDCFilter.processException(e, getClass().getName(), "createArchive");
              return false;
          }
  
          return true;
      }
docs: Archive the specified sourcePath entity to the specified targetPath location.
  If sourcePath is a file, then it is archived to the target location.
  If sourcePath is a directory, then all subordinate files and directories are archived to the target location.
  <p>
  
  @param sourcePath entity to be archived
  @param targetPath location where srcPath is archived
  <p>
  @returns true if the operation is successful, false otherwise