private String getLongName(ITypedElement element) {
   if (element instanceof FileRevisionTypedElement) {
     FileRevisionTypedElement fileRevisionElement = (FileRevisionTypedElement) element;
     return fileRevisionElement.getPath();
   } else if (element instanceof LocalResourceTypedElement) {
     LocalResourceTypedElement typedContent = (LocalResourceTypedElement) element;
     return typedContent.getResource().getFullPath().toString();
   }
   return element.getName();
 }
 /** {@inheritDoc} */
 @Override
 public void commit(IProgressMonitor monitor) throws CoreException {
   if (isDirty()) {
     if (isConnected()) {
       super.commit(monitor);
     } else {
       FileOutputStream out = null;
       File file = path.toFile();
       try {
         if (!file.exists()) FileUtils.createNewFile(file);
         out = new FileOutputStream(file);
         out.write(getContent());
         fDirty = false;
       } catch (IOException e) {
         throw new CoreException(
             new Status(
                 IStatus.ERROR,
                 Activator.getPluginId(),
                 UIText.LocalNonWorkspaceTypedElement_errorWritingContents,
                 e));
       } finally {
         fireContentChanged();
         RepositoryMapping mapping = RepositoryMapping.getMapping(path);
         if (mapping != null) mapping.getRepository().fireEvent(new IndexChangedEvent());
         if (out != null)
           try {
             out.close();
           } catch (IOException ex) {
             // ignore
           }
       }
     }
   }
 }
 /** {@inheritDoc} */
 @Override
 public void setContent(byte[] contents) {
   fDirty = true;
   super.setContent(contents);
 }