@Test public void encodePathForRequest_NonAsciiChars() { String encoded = encodePathForRequest( "/фыв апр" ); String expected = ":" + URLEncoder.encodeUTF8( "фыв" ) + "%20" + URLEncoder.encodeUTF8( "апр" ); assertEquals( expected, encoded ); }
static String encodePathForRequest( String path ) { String pathEncoded = RepositoryPathEncoder.encodeRepositoryPath( path ); String utf8 = RepositoryPathEncoder.encodeURIComponent( pathEncoded ); return utf8.replaceAll( ENCODED_COLON, ":" ); }
JCRSolutionFileModel implements SolutionFileModel { static String encodePathForRequest( String path ) { String pathEncoded = RepositoryPathEncoder.encodeRepositoryPath( path ); String utf8 = RepositoryPathEncoder.encodeURIComponent( pathEncoded ); return utf8.replaceAll( ENCODED_COLON, ":" ); } }
JCRSolutionFileModel implements SolutionFileModel { static String encodePathForRequest( String path ) { String pathEncoded = RepositoryPathEncoder.encodeRepositoryPath( path ); String utf8 = RepositoryPathEncoder.encodeURIComponent( pathEncoded ); return utf8.replaceAll( ENCODED_COLON, ":" ); } JCRSolutionFileModel( final String url,
                               final String username,
                               final String password,
                               final int timeout );   JCRSolutionFileModel( String url, Client client, boolean loadTreePartially ); }
JCRSolutionFileModel implements SolutionFileModel { static String encodePathForRequest( String path ) { String pathEncoded = RepositoryPathEncoder.encodeRepositoryPath( path ); String utf8 = RepositoryPathEncoder.encodeURIComponent( pathEncoded ); return utf8.replaceAll( ENCODED_COLON, ":" ); } JCRSolutionFileModel( final String url,
                               final String username,
                               final String password,
                               final int timeout );   JCRSolutionFileModel( String url, Client client, boolean loadTreePartially ); void refresh(); void createFolder( final FileName file ); RepositoryFileTreeDto getRoot(); void setRoot( final RepositoryFileTreeDto root ); boolean isDirectory( final FileName file ); boolean exists( final FileName file ); boolean isVisible( final FileName file ); void setDescription( final FileName file, final String description ); String getDescription( final FileName file ); long getLastModifiedDate( final FileName file ); String getUrl( final FileName file ); List<RepositoryFileTreeDto> getChildren( final FileName parent ); byte[] getData( final FileName file ); void setData( final FileName file, final byte[] data ); String[] getChilds( final FileName name ); String getLocalizedName( final FileName file ); String getParamServiceUrl( final FileName name ); long getRefreshTime(); void setRefreshTime( final long refreshTime ); HashMap<FileName, String> getDescriptionEntries(); String getMajorVersion(); String getMinorVersion(); String getReleaseVersion(); String getBuildVersion(); String getMilestoneVersion(); long getContentSize( final FileName name ); @Override boolean delete( FileName name ); }
JCRSolutionFileModel implements SolutionFileModel { static String encodePathForRequest( String path ) { String pathEncoded = RepositoryPathEncoder.encodeRepositoryPath( path ); String utf8 = RepositoryPathEncoder.encodeURIComponent( pathEncoded ); return utf8.replaceAll( ENCODED_COLON, ":" ); } JCRSolutionFileModel( final String url,
                               final String username,
                               final String password,
                               final int timeout );   JCRSolutionFileModel( String url, Client client, boolean loadTreePartially ); void refresh(); void createFolder( final FileName file ); RepositoryFileTreeDto getRoot(); void setRoot( final RepositoryFileTreeDto root ); boolean isDirectory( final FileName file ); boolean exists( final FileName file ); boolean isVisible( final FileName file ); void setDescription( final FileName file, final String description ); String getDescription( final FileName file ); long getLastModifiedDate( final FileName file ); String getUrl( final FileName file ); List<RepositoryFileTreeDto> getChildren( final FileName parent ); byte[] getData( final FileName file ); void setData( final FileName file, final byte[] data ); String[] getChilds( final FileName name ); String getLocalizedName( final FileName file ); String getParamServiceUrl( final FileName name ); long getRefreshTime(); void setRefreshTime( final long refreshTime ); HashMap<FileName, String> getDescriptionEntries(); String getMajorVersion(); String getMinorVersion(); String getReleaseVersion(); String getBuildVersion(); String getMilestoneVersion(); long getContentSize( final FileName name ); @Override boolean delete( FileName name ); static final String RETRIEVE_CONTENT_SERVICE; static final String RETRIEVE_PARAMETER_URL_SERVICE; static final String DELETE_FILE_OR_FOLDER; }