throw new CmsSynchronizeException(Messages.get().container(Messages.ERR_EXISTENT_FILE_1, newFile.getPath())); } else { throw new CmsSynchronizeException( Messages.get().container(Messages.ERR_CREATE_DIR_1, newFile.getPath())); throw new CmsSynchronizeException(Messages.get().container( Messages.ERR_CREATE_FILE_1, this.getClass().getName(),
Messages.get().container(Messages.ERR_EXISTENT_FILE_1, newFile.getPath())); } else { throw new CmsSynchronizeException( Messages.get().container(Messages.ERR_CREATE_DIR_1, newFile.getPath())); Messages.get().container(Messages.ERR_CREATE_FILE_1, this.getClass().getName(), newFile.getPath()), e); } finally {
if (!destinationFolder.exists() || !destinationFolder.isDirectory()) { throw new CmsIllegalArgumentException(Messages.get().container( Messages.ERR_RFS_DESTINATION_NOT_THERE_1, destination)); throw new CmsIllegalArgumentException(Messages.get().container( Messages.ERR_RFS_DESTINATION_NO_WRITE_1, destination));
throw new CmsDbIoException(Messages.get().container(Messages.ERR_IO_WRITE_SYNCLIST_0), e); } finally {
throw new CmsSynchronizeException(Messages.get().container(Messages.ERR_READ_SYNC_LIST_0), e); } finally {
throw new CmsDbIoException(Messages.get().container(Messages.ERR_IO_WRITE_SYNCLIST_0), e); } finally {
/** * Translates the resource name. <p> * * This is necessary since the server RFS does allow different naming * conventions than the VFS. * * @param name the resource name to be translated * @return the translated resource name */ private String translate(String name) { String translation = null; // test if an external translation should be used Iterator i = m_synchronizeModifications.iterator(); while (i.hasNext()) { try { translation = ((I_CmsSynchronizeModification)i.next()).translate(m_cms, name); } catch (CmsSynchronizeException e) { if (LOG.isInfoEnabled()) { LOG.info(Messages.get().getBundle().key(Messages.LOG_EXTERNAL_TRANSLATION_1, name), e); } break; } } // if there was no external method called, do the default OpenCms // RFS-VFS translation if (translation == null) { translation = m_cms.getRequestContext().getFileTranslator().translateResource(name); } return translation; }
/** * Translates the resource name. <p> * * This is necessary since the server RFS does allow different naming * conventions than the VFS. * * @param name the resource name to be translated * @return the translated resource name */ private String translate(String name) { String translation = null; // test if an external translation should be used Iterator<I_CmsSynchronizeModification> i = m_synchronizeModifications.iterator(); while (i.hasNext()) { try { translation = i.next().translate(m_cms, name); } catch (CmsSynchronizeException e) { if (LOG.isInfoEnabled()) { LOG.info(Messages.get().getBundle().key(Messages.LOG_EXTERNAL_TRANSLATION_1, name), e); } break; } } // if there was no external method called, do the default OpenCms // RFS-VFS translation if (translation == null) { translation = m_cms.getRequestContext().getFileTranslator().translateResource(name); } return translation; }
/** * Determine if this file is to be excluded.<p> * * @param file the file to check * * @return <code>true</code> if the file should be excluded from synchronization */ private boolean isExcluded(File file) { ArrayList<Pattern> excludes = OpenCms.getWorkplaceManager().getSynchronizeExcludePatterns(); for (Pattern pattern : excludes) { if (pattern.matcher(file.getName()).find()) { m_report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, String.valueOf(m_count++)), I_CmsReport.FORMAT_NOTE); m_report.print(Messages.get().container(Messages.RPT_EXCLUDING_0), I_CmsReport.FORMAT_NOTE); m_report.println( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, file.getAbsolutePath().replace("\\", "/"))); return true; } } return false; }
/** * Updates the synchronization lists if a resource is not used during the * synchronization process.<p> * * @param res the resource whose entry must be updated */ private void skipResource(CmsResource res) { // add the file to the new sync list... String resname = m_cms.getSitePath(res); CmsSynchronizeList syncList = m_syncList.get(translate(resname)); m_newSyncList.put(translate(resname), syncList); // .. and remove it from the old one m_syncList.remove(translate(resname)); // update the report m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, String.valueOf(m_count++)), I_CmsReport.FORMAT_NOTE); m_report.print(Messages.get().container(Messages.RPT_SKIPPING_0), I_CmsReport.FORMAT_NOTE); m_report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_ARGUMENT_1, resname)); }
/** * Updates the synchronization lists if a resource is not used during the * synchronization process.<p> * * @param res the resource whose entry must be updated */ private void skipResource(CmsResource res) { // add the file to the new sync list... String resname = m_cms.getSitePath(res); CmsSynchronizeList syncList = (CmsSynchronizeList)m_syncList.get(translate(resname)); m_newSyncList.put(translate(resname), syncList); // .. and remove it from the old one m_syncList.remove(translate(resname)); // update the report m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, String.valueOf(m_count++)), I_CmsReport.FORMAT_NOTE); m_report.print(Messages.get().container(Messages.RPT_SKIPPING_0), I_CmsReport.FORMAT_NOTE); m_report.println(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, resname)); }
/** * Deletes a resource in the VFS and updates the synchronisation lists.<p> * * @param res The resource to be deleted * * @throws CmsException if something goes wrong */ private void deleteFromVfs(CmsResource res) throws CmsException { String resourcename = m_cms.getSitePath(res); m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, String.valueOf(m_count++)), I_CmsReport.FORMAT_NOTE); if (res.isFile()) { m_report.print(Messages.get().container(Messages.RPT_DEL_FILE_0), I_CmsReport.FORMAT_NOTE); } else { m_report.print(Messages.get().container(Messages.RPT_DEL_FOLDER_0), I_CmsReport.FORMAT_NOTE); } m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, resourcename)); m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); // lock the file in the VFS, so that it can be updated m_cms.lockResource(resourcename); m_cms.deleteResource(resourcename, CmsResource.DELETE_PRESERVE_SIBLINGS); // Remove it from the sync list m_syncList.remove(translate(resourcename)); m_report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK); }
org.opencms.site.Messages.get(), org.opencms.staticexport.Messages.get(), org.opencms.synchronize.Messages.get(), org.opencms.util.Messages.get(), org.opencms.widgets.Messages.get(),