public File uploadFileAudioSource(String audioSource) throws AudioCacheHandlerException {
    // make sure specified file exists, create an
    // entry in the content repository and upload the file.
    String pattern = "file://";

    String s = audioSource;

    int ix = audioSource.indexOf(pattern);

    if (ix >= 0) {
      s = s.substring(ix + pattern.length());
    }

    File file = new File(s);

    if (file.exists() == false) {
      throw new AudioCacheHandlerException("Nonexistent file to upload " + s);
    }

    logger.warning("Upload File: " + s);

    ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();

    ContentRepository repo = registry.getRepository(LoginManager.getPrimary());

    ContentCollection audioCollection = null;

    try {
      ContentCollection c = repo.getUserRoot();

      audioCollection = (ContentCollection) c.getChild("audio");

      if (audioCollection == null) {
        audioCollection = (ContentCollection) c.createChild("audio", Type.COLLECTION);
      }
    } catch (ContentRepositoryException e) {
      throw new AudioCacheHandlerException("Content repository exception: " + e.getMessage());
    }

    try {
      /*
       * Remove file if it exists.
       */
      ContentResource r = (ContentResource) audioCollection.removeChild(file.getName());
    } catch (Exception e) {
    }

    try {
      ContentResource r =
          (ContentResource) audioCollection.createChild(file.getName(), ContentNode.Type.RESOURCE);

      r.put(file);
    } catch (Exception e) {
      throw new AudioCacheHandlerException("Failed to upload file:  " + e.getMessage());
    }

    return file;
  }