code: private DefaultLocalExtension loadDescriptor(File descriptor) throws InvalidExtensionException
      {
          FileInputStream fis;
          try {
              fis = new FileInputStream(descriptor);
          } catch (FileNotFoundException e) {
              throw new InvalidExtensionException("Failed to open descriptor for reading", e);
          }
  
          try {
              DefaultLocalExtension localExtension =
                  this.extensionSerializer.loadLocalExtensionDescriptor(this.repository, fis);
  
              localExtension.setDescriptorFile(descriptor);
              localExtension.setFile(getFile(descriptor, DESCRIPTOR_EXT, localExtension.getType()));
  
              if (!localExtension.getFile().getFile().exists()) {
                  throw new InvalidExtensionException("Failed to load local extension [" + descriptor + "]: ["
                      + localExtension.getFile() + "] file does not exists");
              }
  
              return localExtension;
          } finally {
              try {
                  fis.close();
              } catch (IOException e) {
                  LOGGER.error("Failed to close stream for file [" + descriptor + "]", e);
              }
          }
      }
docs: Local extension descriptor from a file.
  
  @param descriptor the descriptor file
  @return the extension descriptor
  @throws InvalidExtensionException error when trying to load extension descriptor