1 23 24 package org.apache.slide.webdav.util; 25 26 import org.apache.slide.content.NodeRevisionNumber; 27 import org.apache.slide.util.Configuration; 28 29 33 public class DeltavUriRedirector { 34 35 38 public static String redirectUri( String uri ) { 39 String result = uri; 40 41 if( Configuration.useVersionControl() ) { 42 UriHandler rUh = UriHandler.getUriHandler( uri ); 43 if( rUh.isVersionUri() ) 44 result = rUh.getAssociatedHistoryUri(); 45 } 46 47 return result; 48 } 49 50 53 public static NodeRevisionNumber redirectLatestRevisionNumber( String uri ) { 54 NodeRevisionNumber result = null; 55 56 if( Configuration.useVersionControl() ) { 57 UriHandler rUh = UriHandler.getUriHandler( uri ); 58 if( rUh.isHistoryUri() ) { 59 result = NodeRevisionNumber.HIDDEN_0_0; 60 } 61 else if( rUh.isVersionUri() ) { 62 result = new NodeRevisionNumber( rUh.getVersionName() ); 63 } 64 } 65 66 return result; 67 } 68 } 69 70 | Popular Tags |