As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
/** * Creates a new content URL. This must be supported by all * stores that are compatible with Alfresco. * * @return Returns a new and unique content URL */ public static String createNewFileStoreUrl() { Calendar calendar = new GregorianCalendar(); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH) + 1; // 0-based int day = calendar.get(Calendar.DAY_OF_MONTH); int hour = calendar.get(Calendar.HOUR_OF_DAY); int minute = calendar.get(Calendar.MINUTE); // create the URL StringBuilder sb = new StringBuilder(20); sb.append(FileContentStore.STORE_PROTOCOL) .append(ContentStore.PROTOCOL_DELIMITER) .append(year).append('/') .append(month).append('/') .append(day).append('/') .append(hour).append('/') .append(minute).append('/') .append(GUID.generate()).append(".bin"); String newContentUrl = sb.toString(); // done return newContentUrl; }