target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void shouldShowMusicWhenExists() { when(dao.load(music)).thenReturn(music); controller.show(music); assertNotNull(result.included().get("music")); assertThat((Music) result.included().get("music"), is(music)); }
@Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); }
MusicController { @Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); } }
MusicController { @Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); }
MusicController { @Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path("/musics") @Pos...
MusicController { @Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path("/musics") @Pos...
@Test public void supportOverrideTypeHttpMethodAnnotation() throws SecurityException, NoSuchMethodException { List<Route> routes = parser.rulesFor(new DefaultBeanClass(AnnotatedController.class)); Route route = getRouteMatching(routes, "/annotated/overridden"); assertThat(route.allowedMethods(), is(EnumSet.of(HttpMetho...
@Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
@Test public void strippsContextPath() { when(request.getContextPath()).thenReturn("/myapp"); when(request.getRequestURI()).thenReturn("/myapp/somepage"); assertThat(vraptor.getRequestedUri(), is(equalTo("/somepage"))); }
@Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); }
VRaptorRequest extends HttpServletRequestWrapper implements MutableRequest { @Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); } }
VRaptorRequest extends HttpServletRequestWrapper implements MutableRequest { @Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); } V...
VRaptorRequest extends HttpServletRequestWrapper implements MutableRequest { @Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); } V...
VRaptorRequest extends HttpServletRequestWrapper implements MutableRequest { @Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); } V...
@Test public void shouldNotShowMusicWhenDoesNotExists() { when(dao.load(music)).thenReturn(null); controller.show(music); assertNull(result.included().get("music")); }
@Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); }
MusicController { @Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); } }
MusicController { @Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); }
MusicController { @Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path("/musics") @Pos...
MusicController { @Path("/musics/{music.id}") @Get public void show(Music music) { result.include("music", musicDao.load(music)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path("/musics") @Pos...
@SuppressWarnings("unchecked") @Test public void shouldReturnMusicList() { when(dao.searchSimilarTitle(music.getTitle())).thenReturn(Arrays.asList(music)); controller.search(music); assertThat((List<Music>) result.included().get("musics"), contains(music)); }
@Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); }
MusicController { @Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); } }
MusicController { @Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, ...
MusicController { @Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, ...
MusicController { @Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, ...
@SuppressWarnings("unchecked") @Test public void shouldReturnEmptyList() { when(dao.searchSimilarTitle(music.getTitle())).thenReturn(new ArrayList<Music>()); controller.search(music); List<Music> musics = (List<Music>) result.included().get("musics"); assertThat(musics, empty()); }
@Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); }
MusicController { @Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); } }
MusicController { @Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, ...
MusicController { @Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, ...
MusicController { @Get("/musics/search") public void search(Music music) { String title = MoreObjects.firstNonNull(music.getTitle(), ""); result.include("musics", this.musicDao.searchSimilarTitle(title)); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, ...
@Test public void shouldNotDownloadMusicWhenDoesNotExist() { when(dao.load(music)).thenReturn(music); when(musics.getFile(music)).thenReturn(new File("/tmp/uploads/Music_" + music.getId() + ".mp3")); try { controller.download(music); fail("Should throw an exception."); } catch (FileNotFoundException e) { verify(musics)...
@Path("/musics/download/{m.id}") @Get public Download download(Music m) throws FileNotFoundException { Music music = musicDao.load(m); File file = musics.getFile(music); String contentType = "audio/mpeg"; String filename = music.getTitle() + ".mp3"; return new FileDownload(file, contentType, filename); }
MusicController { @Path("/musics/download/{m.id}") @Get public Download download(Music m) throws FileNotFoundException { Music music = musicDao.load(m); File file = musics.getFile(music); String contentType = "audio/mpeg"; String filename = music.getTitle() + ".mp3"; return new FileDownload(file, contentType, filename)...
MusicController { @Path("/musics/download/{m.id}") @Get public Download download(Music m) throws FileNotFoundException { Music music = musicDao.load(m); File file = musics.getFile(music); String contentType = "audio/mpeg"; String filename = music.getTitle() + ".mp3"; return new FileDownload(file, contentType, filename)...
MusicController { @Path("/musics/download/{m.id}") @Get public Download download(Music m) throws FileNotFoundException { Music music = musicDao.load(m); File file = musics.getFile(music); String contentType = "audio/mpeg"; String filename = music.getTitle() + ".mp3"; return new FileDownload(file, contentType, filename)...
MusicController { @Path("/musics/download/{m.id}") @Get public Download download(Music m) throws FileNotFoundException { Music music = musicDao.load(m); File file = musics.getFile(music); String contentType = "audio/mpeg"; String filename = music.getTitle() + ".mp3"; return new FileDownload(file, contentType, filename)...
@Test public void shouldShowAllMusicsAsJSON() throws Exception { when(dao.listAll()).thenReturn(Arrays.asList(music)); controller.showAllMusicsAsJSON(); assertThat(result.serializedResult(), is("{\"list\":[{\"id\":1,\"title\":\"Some Music\"," + "\"description\":\"Some description\",\"type\":\"ROCK\"}]}")); }
@Public @Path("/musics/list/json") public void showAllMusicsAsJSON() { result.use(json()).from(musicDao.listAll()).serialize(); }
MusicController { @Public @Path("/musics/list/json") public void showAllMusicsAsJSON() { result.use(json()).from(musicDao.listAll()).serialize(); } }
MusicController { @Public @Path("/musics/list/json") public void showAllMusicsAsJSON() { result.use(json()).from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); }
MusicController { @Public @Path("/musics/list/json") public void showAllMusicsAsJSON() { result.use(json()).from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path...
MusicController { @Public @Path("/musics/list/json") public void showAllMusicsAsJSON() { result.use(json()).from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path...
@Test public void shouldShowAllMusicsAsXML() throws Exception { when(dao.listAll()).thenReturn(Arrays.asList(music)); controller.showAllMusicsAsXML(); assertThat(result.serializedResult(), is("<list><music><id>1</id><title>Some Music</title><description>Some description</description><type>ROCK</type></music></list>"));...
@Public @Path("/musics/list/xml") public void showAllMusicsAsXML() { result.use(xml()).from(musicDao.listAll()).serialize(); }
MusicController { @Public @Path("/musics/list/xml") public void showAllMusicsAsXML() { result.use(xml()).from(musicDao.listAll()).serialize(); } }
MusicController { @Public @Path("/musics/list/xml") public void showAllMusicsAsXML() { result.use(xml()).from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); }
MusicController { @Public @Path("/musics/list/xml") public void showAllMusicsAsXML() { result.use(xml()).from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path("/...
MusicController { @Public @Path("/musics/list/xml") public void showAllMusicsAsXML() { result.use(xml()).from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path("/...
@Test public void shouldShowAllMusicsAsHTTP() { MockHttpResult mockHttpResult = new MockHttpResult(); controller = new MusicController(dao, userInfo, mockHttpResult, validator, musics, userDao); when(dao.listAll()).thenReturn(Arrays.asList(music)); controller.showAllMusicsAsHTTP(); assertThat(mockHttpResult.getBody(), ...
@Public @Path("/musics/list/http") public void showAllMusicsAsHTTP() { result.use(http()).body("<p class=\"content\">"+ musicDao.listAll().toString()+"</p>"); }
MusicController { @Public @Path("/musics/list/http") public void showAllMusicsAsHTTP() { result.use(http()).body("<p class=\"content\">"+ musicDao.listAll().toString()+"</p>"); } }
MusicController { @Public @Path("/musics/list/http") public void showAllMusicsAsHTTP() { result.use(http()).body("<p class=\"content\">"+ musicDao.listAll().toString()+"</p>"); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics ...
MusicController { @Public @Path("/musics/list/http") public void showAllMusicsAsHTTP() { result.use(http()).body("<p class=\"content\">"+ musicDao.listAll().toString()+"</p>"); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics ...
MusicController { @Public @Path("/musics/list/http") public void showAllMusicsAsHTTP() { result.use(http()).body("<p class=\"content\">"+ musicDao.listAll().toString()+"</p>"); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics ...
@Test public void shouldListAs() throws Exception { when(dao.listAll()).thenReturn(Arrays.asList(music)); controller.listAs(); assertThat(result.serializedResult(), is("<list><music><id>1</id><title>Some Music</title><description>Some description</description><type>ROCK</type></music></list>")); }
@Public @Path("musics/listAs") public void listAs() { result.use(representation()) .from(musicDao.listAll()).serialize(); }
MusicController { @Public @Path("musics/listAs") public void listAs() { result.use(representation()) .from(musicDao.listAll()).serialize(); } }
MusicController { @Public @Path("musics/listAs") public void listAs() { result.use(representation()) .from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); }
MusicController { @Public @Path("musics/listAs") public void listAs() { result.use(representation()) .from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path("/mus...
MusicController { @Public @Path("musics/listAs") public void listAs() { result.use(representation()) .from(musicDao.listAll()).serialize(); } protected MusicController(); @Inject MusicController(MusicDao musicDao, UserInfo userInfo, Result result, Validator validator, Musics musics, UserDao userDao); @Path("/mus...
@Test public void addsAPrefixToMethodsWhenTheGetControllerAndTheMethodAreAnnotatedWithRelativePath() throws Exception { List<Route> routes = parser.rulesFor(new DefaultBeanClass(GetAnnotatedController.class)); Route route = getRouteMatching(routes, "/prefix/relativePath"); assertThat(route, canHandle(GetAnnotatedContro...
@Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
@Test public void priorityForGetAnnotationShouldBeDefault() throws Exception { List<Route> routes = parser.rulesFor(new DefaultBeanClass(GetAnnotatedController.class)); Route route = getRouteMatching(routes, "/prefix/relativePath"); assertThat(route.getPriority(), is(Path.DEFAULT)); }
@Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
@Test public void addsAPrefixToMethodsWhenTheGetControllerEndsWithSlashAndTheMethodAreAnnotatedWithRelativePath() throws Exception { List<Route> routes = parser.rulesFor(new DefaultBeanClass(EndSlashAnnotatedGetController.class)); Route route = getRouteMatching(routes, "/endSlash/relativePath"); assertThat(route, canHa...
@Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
@Test public void addsAPrefixToMethodsWhenTheGetControllerEndsWithSlashAndTheMethodAreAnnotatedWithAbsolutePath() throws Exception { List<Route> routes = parser.rulesFor(new DefaultBeanClass(EndSlashAnnotatedGetController.class)); Route route = getRouteMatching(routes, "/endSlash/absolutePath"); assertThat(route, canHa...
@Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
@Test public void addsAPrefixToMethodsWhenTheGetControllerAndTheMethodAreAnnotatedWithAbsolutePath() throws Exception { List<Route> routes = parser.rulesFor(new DefaultBeanClass(GetAnnotatedController.class)); Route route = getRouteMatching(routes, "/prefix/absolutePath"); assertThat(route, canHandle(GetAnnotatedContro...
@Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
@Test public void addsAPrefixToMethodsWhenTheGetControllerIsAnnotatedWithPath() throws Exception { List<Route> routes = parser.rulesFor(new DefaultBeanClass(GetAnnotatedController.class)); Route route = getRouteMatching(routes, "/prefix/withoutPath"); assertThat(route, canHandle(GetAnnotatedController.class, "withoutPa...
@Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
@Test public void throwsExceptionWhenTheGetControllerHasAmbiguousDeclaration() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("You should specify paths either in @Path(\"/path\") or @Get(\"/path\") (or @Post, @Put, @Delete), not both at"); parser.rulesFor(new DefaultBeanCla...
@Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } }
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
PathAnnotationRoutesParser implements RoutesParser { @Override public List<Route> rulesFor(BeanClass controller) { Class<?> baseType = controller.getType(); return registerRulesFor(baseType); } protected PathAnnotationRoutesParser(); @Inject PathAnnotationRoutesParser(Router router, ReflectionProvider reflectionProvi...
@Test public void allowsAdditionOfRouteBuildersByDefaultWithNoStrategy() { exception.expect(IllegalRouteException.class); new Rules(router) { @Override public void routes() { routeFor(""); } }; }
protected final RouteBuilder routeFor(String uri) { RouteBuilder rule = router.builderFor(uri); rule.withPriority(Integer.MIN_VALUE); this.routesToBuild.add(rule); return rule; }
Rules { protected final RouteBuilder routeFor(String uri) { RouteBuilder rule = router.builderFor(uri); rule.withPriority(Integer.MIN_VALUE); this.routesToBuild.add(rule); return rule; } }
Rules { protected final RouteBuilder routeFor(String uri) { RouteBuilder rule = router.builderFor(uri); rule.withPriority(Integer.MIN_VALUE); this.routesToBuild.add(rule); return rule; } Rules(Router router); }
Rules { protected final RouteBuilder routeFor(String uri) { RouteBuilder rule = router.builderFor(uri); rule.withPriority(Integer.MIN_VALUE); this.routesToBuild.add(rule); return rule; } Rules(Router router); abstract void routes(); }
Rules { protected final RouteBuilder routeFor(String uri) { RouteBuilder rule = router.builderFor(uri); rule.withPriority(Integer.MIN_VALUE); this.routesToBuild.add(rule); return rule; } Rules(Router router); abstract void routes(); }
@Test public void shouldInvokeAGetter() { assertThat((Long) evaluator.get(client(1L), "client.id"), is(equalTo(1L))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void shouldInvokeAIs() { Client c = client(1L); c.ugly=true; assertThat((Boolean) evaluator.get(c, "client.ugly"), is(equalTo(true))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void strippsRootContextPath() { when(request.getContextPath()).thenReturn("/"); when(request.getRequestURI()).thenReturn("/somepage"); assertThat(vraptor.getRequestedUri(), is(equalTo("/somepage"))); }
@Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); }
VRaptorRequest extends HttpServletRequestWrapper implements MutableRequest { @Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); } }
VRaptorRequest extends HttpServletRequestWrapper implements MutableRequest { @Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); } V...
VRaptorRequest extends HttpServletRequestWrapper implements MutableRequest { @Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); } V...
VRaptorRequest extends HttpServletRequestWrapper implements MutableRequest { @Override public String getRequestedUri() { if (getAttribute(INCLUDE_REQUEST_URI) != null) { return (String) getAttribute(INCLUDE_REQUEST_URI); } String uri = getRelativeRequestURI(this); return uri.replaceFirst("(?i);jsessionid=.*$", ""); } V...
@Test public void shouldAccessArray() { Client c = client(1L); c.favoriteColors = new String[] {"blue", "red"}; assertThat((String) evaluator.get(c, "client.favoriteColors[1]"), is(equalTo("red"))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void shouldAccessList() { Client c = client(1L); c.emails = Arrays.asList("blue", "red"); assertThat((String) evaluator.get(c, "client.emails[1]"), is(equalTo("red"))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void shouldAccessCollection() { Client c = client(1L); c.favoriteNumbers = new TreeSet<>(Arrays.asList(10, 5)); assertThat((Integer) evaluator.get(c, "client.favoriteNumbers[1]"), is(equalTo(10))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void shouldReturnEmptyStringIfNullWasFoundOnTheWay() { Client c = client(1L); assertThat((String) evaluator.get(c, "client.child.id"), is(equalTo(""))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void shouldReturnEmptyStringIfTheResultIsNull() { Client c = client(null); assertThat((String) evaluator.get(c, "client.id"), is(equalTo(""))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void shouldInvokeAGetterDeclaredOnSuperClass() { Client c = vipClient(1L); assertThat((Long) evaluator.get(c, "client.id"), is(equalTo(1L))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void shouldInvokeAIsDeclaredOnSuperClass() { Client c = vipClient(1L); c.ugly = true; assertThat((Boolean) evaluator.get(c, "client.ugly"), is(equalTo(true))); }
@Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorException("Unable to evaluate expressi...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
JavaEvaluator implements Evaluator { @Override public Object get(Object root, String path) { if (root == null) { return null; } String[] paths = path.split("[\\]\\.]"); Object current = root; for (int i = 1; i < paths.length; i++) { try { current = navigate(current, paths[i]); } catch (Exception e) { throw new VRaptorE...
@Test public void shouldReturnTheFirstRouteFound() throws Exception { Method method = MyController.class.getDeclaredMethod("listDogs", Integer.class); registerRulesFor(MyController.class); assertEquals("/dogs/1", router.urlFor(MyController.class, method, new Object[] { "1" })); }
@Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new Supplier<Route>() { @Override publ...
DefaultRouter implements Router { @Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new ...
DefaultRouter implements Router { @Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new ...
DefaultRouter implements Router { @Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new ...
DefaultRouter implements Router { @Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new ...
@Test public void canFindUrlForProxyClasses() throws Exception { registerRulesFor(MyController.class); MyController proxy = proxifier.proxify(MyController.class, null); Class<? extends MyController> type = proxy.getClass(); Method method = type.getMethod("notAnnotated"); assertEquals("/my/notAnnotated", router.urlFor(t...
@Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new Supplier<Route>() { @Override publ...
DefaultRouter implements Router { @Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new ...
DefaultRouter implements Router { @Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new ...
DefaultRouter implements Router { @Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new ...
DefaultRouter implements Router { @Override public <T> String urlFor(final Class<T> type, final Method method, Object... params) { final Class<?> rawtype = proxifier.isProxyType(type) ? type.getSuperclass() : type; final Invocation invocation = new Invocation(rawtype, method); Route route = cache.fetch(invocation, new ...
@Test public void shouldNameObjectTypeAsItsSimpleName() throws SecurityException, NoSuchMethodException { Parameter[] namesFor = provider.parametersFor(Horse.class.getMethod("runThrough", Field.class)); assertThat(toNames(namesFor), contains("f")); }
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void registerExtraParametersFromAcessedUrl() throws SecurityException, NoSuchMethodException { DefaultParametersControl control = getDefaultParameterControlForUrl("/clients/{dog.id}"); control.fillIntoRequest("/clients/45", request); verify(request).setParameter("dog.id", new String[] {"45"}); }
@Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i), encodingHandler.getEncoding())); } catch (Unsupported...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
@Test public void shouldNamePrimitiveTypeAsItsSimpleName() throws SecurityException, NoSuchMethodException { Parameter[] namesFor = provider.parametersFor(Horse.class.getMethod("rest", int.class)); assertThat(toNames(namesFor), contains("hours")); }
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void shouldNameArrayAsItsSimpleTypeName() throws SecurityException, NoSuchMethodException { Parameter[] namesFor = provider.parametersFor(Horse.class.getMethod("setLeg", int[].class)); assertThat(toNames(namesFor), contains("length")); }
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void shouldNameGenericCollectionUsingOf() throws SecurityException, NoSuchMethodException { Parameter[] namesFor = provider.parametersFor(Cat.class.getDeclaredMethod("fightWith", List.class)); assertThat(toNames(namesFor), contains("cats")); }
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void shouldIgnoreChangesToTheReturnedArrayInSubsequentCalls() throws Exception { Parameter[] firstCall = provider.parametersFor(Horse.class.getMethod("setLeg", int[].class)); firstCall[0] = null; Parameter[] secondCall = provider.parametersFor(Horse.class.getMethod("setLeg", int[].class)); assertThat(secon...
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void shouldNameFieldsAnnotatedWithNamed() throws SecurityException, NoSuchMethodException { Parameter[] namesFor = provider.parametersFor(Horse.class.getMethod("runThroughWithAnnotation", Field.class)); assertThat(toNames(namesFor), contains("one")); }
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void shouldNotNameFieldsByTheFieldNameWhenUsingAnnotation() throws SecurityException, NoSuchMethodException { Parameter[] namesFor = provider.parametersFor(Horse.class.getMethod("runThroughWithAnnotation", Field.class)); assertThat(toNames(namesFor), not(contains("field"))); }
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void shouldNameMethodsFieldsWhenAnnotatedOrNot() throws SecurityException, NoSuchMethodException { Parameter[] namesFor = provider.parametersFor(Horse.class.getMethod("runThroughWithAnnotation2", Field.class, Field.class)); assertThat(toNames(namesFor), contains("one", "two")); }
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void shouldNameMethodsFieldsWhenAnnotatedOrNot2() throws SecurityException, NoSuchMethodException { Parameter[] namesFor = provider.parametersFor(Horse.class.getMethod("runThroughWithAnnotation3", Field.class, Field.class)); assertThat(toNames(namesFor), contains("one", "size")); }
@Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", executable, (Object) names); for (int i = 0; i < names.length;...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
ParanamerNameProvider implements ParameterNameProvider { @Override public Parameter[] parametersFor(final AccessibleObject executable) { try { String[] names = info.lookupParameterNames(executable); Parameter[] params = new Parameter[names.length]; logger.debug("Found parameter names with paranamer for {} as {}", execu...
@Test public void handlesInclude() { when(request.getAttribute(INCLUDE_REQUEST_URI)).thenReturn("/url"); when(request.getMethod()).thenReturn("POST"); when(router.parse("/url", HttpMethod.POST, webRequest)).thenReturn(method); ControllerMethod controller = translator.translate(webRequest); assertThat(controller, is(sam...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void canHandleTheCorrectMethod() { when(request.getRequestURI()).thenReturn("/url"); when(request.getMethod()).thenReturn("POST"); when(router.parse("/url", HttpMethod.POST,webRequest)).thenReturn(method); ControllerMethod controller = translator.translate(webRequest); assertThat(controller, is(equalTo(met...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void registerParametersWithAsterisks() throws SecurityException, NoSuchMethodException { DefaultParametersControl control = getDefaultParameterControlForUrl("/clients/{my.path*}"); control.fillIntoRequest("/clients/one/path", request); verify(request).setParameter("my.path", new String[] {"one/path"}); }
@Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i), encodingHandler.getEncoding())); } catch (Unsupported...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
@Test public void shouldAcceptCaseInsensitiveRequestMethods() { when(request.getRequestURI()).thenReturn("/url"); when(request.getMethod()).thenReturn("pOsT"); when(router.parse("/url", HttpMethod.POST,webRequest)).thenReturn(method); ControllerMethod controller = translator.translate(webRequest); assertThat(controller...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void shouldAcceptCaseInsensitiveGetRequestUsingThe_methodParameter() { when(request.getRequestURI()).thenReturn("/url"); when(request.getParameter("_method")).thenReturn("gEt"); when(request.getMethod()).thenReturn("POST"); when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method); Controll...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void shouldThrowExceptionWhenRequestANotKnownMethod() { exception.expect(MethodNotAllowedException.class); exception.expectMessage("Method COOK is not allowed for requested URI. Allowed Methods are [GET, POST]"); when(request.getRequestURI()).thenReturn("/url"); when(request.getMethod()).thenReturn("COOK")...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void shouldOverrideTheHttpMethodByUsingThe_methodParameter() { when(request.getRequestURI()).thenReturn("/url"); when(request.getParameter("_method")).thenReturn("DELETE"); when(request.getMethod()).thenReturn("POST"); when(router.parse("/url", HttpMethod.DELETE, webRequest)).thenReturn(method); Controller...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void canHandleUrlIfRootContext() { when(request.getRequestURI()).thenReturn("/url"); when(request.getContextPath()).thenReturn(""); when(request.getMethod()).thenReturn("GET"); when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method); ControllerMethod controller = translator.translate(webR...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void canHandleUrlIfNonRootContext() { when(request.getRequestURI()).thenReturn("/custom_context/url"); when(request.getContextPath()).thenReturn("/custom_context"); when(request.getMethod()).thenReturn("GET"); when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method); ControllerMethod contr...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void canHandleUrlIfPlainRootContext() { when(request.getRequestURI()).thenReturn("/"); when(request.getMethod()).thenReturn("GET"); when(router.parse("/", HttpMethod.GET, webRequest)).thenReturn(method); ControllerMethod controller = translator.translate(webRequest); assertThat(controller, is(equalTo(metho...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void canHandleComposedUrlIfPlainRootContext() { when(request.getRequestURI()).thenReturn("/products/1"); when(request.getMethod()).thenReturn("GET"); when(router.parse("/products/1", HttpMethod.GET, webRequest)).thenReturn(method); ControllerMethod controller = translator.translate(webRequest); assertThat(...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void canHandleComposedUrlIfNonRootContext() { when(request.getRequestURI()).thenReturn("/custom_context/products/1"); when(request.getContextPath()).thenReturn("/custom_context"); when(request.getMethod()).thenReturn("GET"); when(router.parse("/products/1", HttpMethod.GET, webRequest)).thenReturn(method); ...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void canHandleUrlWithAppendedJSessionID() { when(request.getRequestURI()).thenReturn( "/custom_context/products/1;jsessionid=aslfasfaslkj22234lkjsdfaklsf", "/custom_context/products/1;JSESSIONID=aslfasfaslkj22234lkjsdfaklsf", "/custom_context/products/1;jsessionID=aslfasfaslkj22234lkjsdfaklsf"); when(reque...
@Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod controller = router.parse(controllerName, method, request); logger.de...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
DefaultControllerTranslator implements UrlToControllerTranslator { @Override public ControllerMethod translate(MutableRequest request) { String controllerName = request.getRequestedUri(); logger.debug("trying to access {}", controllerName); HttpMethod method = getHttpMethod(request, controllerName); ControllerMethod co...
@Test public void registerParametersWithRegexes() throws SecurityException, NoSuchMethodException { DefaultParametersControl control = getDefaultParameterControlForUrl("/clients/{hexa:[0-9A-Z]+}"); control.fillIntoRequest("/clients/FAF323", request); verify(request).setParameter("hexa", new String[] {"FAF323"}); }
@Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i), encodingHandler.getEncoding())); } catch (Unsupported...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
DefaultParametersControl implements ParametersControl { @Override public void fillIntoRequest(String uri, MutableRequest request) { Matcher m = pattern.matcher(uri); m.matches(); for (int i = 1; i <= m.groupCount(); i++) { String name = parameters.get(i - 1); try { request.setParameter(name, URLDecoder.decode(m.group(i...
@Test public void testRemoveNotExistTag() { AVSessionCacheHelper.getTagCacheInstance().addSession(testClientId, testClientTag); AVSessionCacheHelper.getTagCacheInstance().removeSession("test11"); Map<String, String> map = AVSessionCacheHelper.getTagCacheInstance().getAllSession(); Assert.assertTrue(map.size() == 1); As...
static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
@Test public void testRemoveMetaData() { String key = "key"; String value = "value"; AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); Assert.assertTrue(!file.getMetaData().containsKey(key)); file.addMetaData(key, value); Assert.assertEquals(file.getMetaData().get(key), value); file.removeMetaData(key); A...
public Object removeMetaData(String key) { return metaData.remove(key); }
AVFile { public Object removeMetaData(String key) { return metaData.remove(key); } }
AVFile { public Object removeMetaData(String key) { return metaData.remove(key); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); pr...
AVFile { public Object removeMetaData(String key) { return metaData.remove(key); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); pr...
AVFile { public Object removeMetaData(String key) { return metaData.remove(key); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); pr...
@Test public void testClearMetaData() { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); Assert.assertTrue(!file.getMetaData().isEmpty()); file.clearMetaData(); Assert.assertTrue(file.getMetaData().isEmpty()); }
public void clearMetaData() { this.metaData.clear(); }
AVFile { public void clearMetaData() { this.metaData.clear(); } }
AVFile { public void clearMetaData() { this.metaData.clear(); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); protected AVFile(Str...
AVFile { public void clearMetaData() { this.metaData.clear(); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); protected AVFile(Str...
AVFile { public void clearMetaData() { this.metaData.clear(); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); protected AVFile(Str...
@Test public void testGetOwnerObjectId() { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); Assert.assertTrue(AVUtils.isBlankContent(file.getOwnerObjectId())); }
public String getOwnerObjectId() { return (String) getMetaData("owner"); }
AVFile { public String getOwnerObjectId() { return (String) getMetaData("owner"); } }
AVFile { public String getOwnerObjectId() { return (String) getMetaData("owner"); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); p...
AVFile { public String getOwnerObjectId() { return (String) getMetaData("owner"); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); p...
AVFile { public String getOwnerObjectId() { return (String) getMetaData("owner"); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); p...
@Test public void testWithObjectIdInBackground() throws Exception { final AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.save(); final CountDownLatch latch = new CountDownLatch(1); AVFile.withObjectIdInBackground(file.getObjectId(), new GetFileCallback<AVFile>() { @Override public void done(AVFile...
public static void withObjectIdInBackground(final String objectId, final GetFileCallback<AVFile> cb) { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); query.getInBackground(objectId, new GetCallback<AVObject>() { @Override public void done(AVObject object, AVException e) { if (e != null) { if (null != cb) { c...
AVFile { public static void withObjectIdInBackground(final String objectId, final GetFileCallback<AVFile> cb) { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); query.getInBackground(objectId, new GetCallback<AVObject>() { @Override public void done(AVObject object, AVException e) { if (e != null) { if (null !...
AVFile { public static void withObjectIdInBackground(final String objectId, final GetFileCallback<AVFile> cb) { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); query.getInBackground(objectId, new GetCallback<AVObject>() { @Override public void done(AVObject object, AVException e) { if (e != null) { if (null !...
AVFile { public static void withObjectIdInBackground(final String objectId, final GetFileCallback<AVFile> cb) { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); query.getInBackground(objectId, new GetCallback<AVObject>() { @Override public void done(AVObject object, AVException e) { if (e != null) { if (null !...
AVFile { public static void withObjectIdInBackground(final String objectId, final GetFileCallback<AVFile> cb) { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); query.getInBackground(objectId, new GetCallback<AVObject>() { @Override public void done(AVObject object, AVException e) { if (e != null) { if (null !...
@Test public void testSaveInBackground() throws Exception { final CountDownLatch latch = new CountDownLatch(1); final AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.saveInBackground(new SaveCallback() { @Override protected boolean mustRunOnUIThread() { return false; } @Override public void done(AV...
public synchronized void saveInBackground(final SaveCallback saveCallback, final ProgressCallback progressCallback) { if (AVUtils.isBlankString(objectId)) { cancelUploadIfNeed(); uploader = getUploader(saveCallback, progressCallback); uploader.execute(); } else { if (null != saveCallback) { saveCallback.internalDone(nu...
AVFile { public synchronized void saveInBackground(final SaveCallback saveCallback, final ProgressCallback progressCallback) { if (AVUtils.isBlankString(objectId)) { cancelUploadIfNeed(); uploader = getUploader(saveCallback, progressCallback); uploader.execute(); } else { if (null != saveCallback) { saveCallback.intern...
AVFile { public synchronized void saveInBackground(final SaveCallback saveCallback, final ProgressCallback progressCallback) { if (AVUtils.isBlankString(objectId)) { cancelUploadIfNeed(); uploader = getUploader(saveCallback, progressCallback); uploader.execute(); } else { if (null != saveCallback) { saveCallback.intern...
AVFile { public synchronized void saveInBackground(final SaveCallback saveCallback, final ProgressCallback progressCallback) { if (AVUtils.isBlankString(objectId)) { cancelUploadIfNeed(); uploader = getUploader(saveCallback, progressCallback); uploader.execute(); } else { if (null != saveCallback) { saveCallback.intern...
AVFile { public synchronized void saveInBackground(final SaveCallback saveCallback, final ProgressCallback progressCallback) { if (AVUtils.isBlankString(objectId)) { cancelUploadIfNeed(); uploader = getUploader(saveCallback, progressCallback); uploader.execute(); } else { if (null != saveCallback) { saveCallback.intern...
@Test public void testParseFileWithObjectId() throws Exception { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.save(); AVFile newFile = AVFile.parseFileWithObjectId(file.getObjectId()); Assert.assertNotNull(newFile); Assert.assertNotNull(newFile.getObjectId()); Assert.assertNotNull(newFile.getOri...
@Deprecated static public AVFile parseFileWithObjectId(String objectId) throws AVException, FileNotFoundException { return withObjectId(objectId); }
AVFile { @Deprecated static public AVFile parseFileWithObjectId(String objectId) throws AVException, FileNotFoundException { return withObjectId(objectId); } }
AVFile { @Deprecated static public AVFile parseFileWithObjectId(String objectId) throws AVException, FileNotFoundException { return withObjectId(objectId); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String,...
AVFile { @Deprecated static public AVFile parseFileWithObjectId(String objectId) throws AVException, FileNotFoundException { return withObjectId(objectId); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String,...
AVFile { @Deprecated static public AVFile parseFileWithObjectId(String objectId) throws AVException, FileNotFoundException { return withObjectId(objectId); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String,...
@Test public void testWithObjectId() throws Exception { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.save(); AVFile newFile = AVFile.withObjectId(file.getObjectId()); Assert.assertNotNull(newFile); Assert.assertNotNull(newFile.getObjectId()); Assert.assertNotNull(newFile.getOriginalName()); Asse...
public static AVFile withObjectId(String objectId) throws AVException, FileNotFoundException { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(objectId); if (object != null && !AVUtils.isBlankString(object.getObjectId())) { AVFile file = createFileFromAVObject(object); return file;...
AVFile { public static AVFile withObjectId(String objectId) throws AVException, FileNotFoundException { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(objectId); if (object != null && !AVUtils.isBlankString(object.getObjectId())) { AVFile file = createFileFromAVObject(object); ret...
AVFile { public static AVFile withObjectId(String objectId) throws AVException, FileNotFoundException { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(objectId); if (object != null && !AVUtils.isBlankString(object.getObjectId())) { AVFile file = createFileFromAVObject(object); ret...
AVFile { public static AVFile withObjectId(String objectId) throws AVException, FileNotFoundException { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(objectId); if (object != null && !AVUtils.isBlankString(object.getObjectId())) { AVFile file = createFileFromAVObject(object); ret...
AVFile { public static AVFile withObjectId(String objectId) throws AVException, FileNotFoundException { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(objectId); if (object != null && !AVUtils.isBlankString(object.getObjectId())) { AVFile file = createFileFromAVObject(object); ret...
@Test public void testWithAVObject() throws Exception { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.save(); AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(file.getObjectId()); AVFile newFile = AVFile.withAVObject(object); Assert.assertEquals(file.getOrigin...
public static AVFile withAVObject(AVObject obj) { if (obj != null && !AVUtils.isBlankString(obj.getObjectId())) { AVFile file = createFileFromAVObject(obj); return file; } else { throw new IllegalArgumentException("Invalid AVObject."); } }
AVFile { public static AVFile withAVObject(AVObject obj) { if (obj != null && !AVUtils.isBlankString(obj.getObjectId())) { AVFile file = createFileFromAVObject(obj); return file; } else { throw new IllegalArgumentException("Invalid AVObject."); } } }
AVFile { public static AVFile withAVObject(AVObject obj) { if (obj != null && !AVUtils.isBlankString(obj.getObjectId())) { AVFile file = createFileFromAVObject(obj); return file; } else { throw new IllegalArgumentException("Invalid AVObject."); } } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String...
AVFile { public static AVFile withAVObject(AVObject obj) { if (obj != null && !AVUtils.isBlankString(obj.getObjectId())) { AVFile file = createFileFromAVObject(obj); return file; } else { throw new IllegalArgumentException("Invalid AVObject."); } } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String...
AVFile { public static AVFile withAVObject(AVObject obj) { if (obj != null && !AVUtils.isBlankString(obj.getObjectId())) { AVFile file = createFileFromAVObject(obj); return file; } else { throw new IllegalArgumentException("Invalid AVObject."); } } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String...
@Test public void testWithAbsoluteLocalPath() throws Exception { File file = new File(getAVFileCachePath(), "test"); AVPersistenceUtils.saveContentToFile(TEST_FILE_CONTENT, file); AVFile newFile = AVFile.withAbsoluteLocalPath("name", file.getAbsolutePath()); Assert.assertNotNull(newFile); Assert.assertNotNull(newFile.g...
public static AVFile withAbsoluteLocalPath(String name, String absoluteLocalFilePath) throws FileNotFoundException { return withFile(name, new File(absoluteLocalFilePath)); }
AVFile { public static AVFile withAbsoluteLocalPath(String name, String absoluteLocalFilePath) throws FileNotFoundException { return withFile(name, new File(absoluteLocalFilePath)); } }
AVFile { public static AVFile withAbsoluteLocalPath(String name, String absoluteLocalFilePath) throws FileNotFoundException { return withFile(name, new File(absoluteLocalFilePath)); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String nam...
AVFile { public static AVFile withAbsoluteLocalPath(String name, String absoluteLocalFilePath) throws FileNotFoundException { return withFile(name, new File(absoluteLocalFilePath)); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String nam...
AVFile { public static AVFile withAbsoluteLocalPath(String name, String absoluteLocalFilePath) throws FileNotFoundException { return withFile(name, new File(absoluteLocalFilePath)); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String nam...
@Test public void testWithFile() throws Exception { File file = new File(getAVFileCachePath(), "test"); AVPersistenceUtils.saveContentToFile(TEST_FILE_CONTENT, file); AVFile newFile = AVFile.withFile("name", file); Assert.assertNotNull(newFile); Assert.assertNotNull(newFile.getOriginalName()); Assert.assertNotNull(newF...
public static AVFile withFile(String name, File file) throws FileNotFoundException { if (file == null) { throw new IllegalArgumentException("null file object."); } if (!file.exists() || !file.isFile()) { throw new FileNotFoundException(); } AVFile avFile = new AVFile(); avFile.setLocalPath(file.getAbsolutePath()); avFi...
AVFile { public static AVFile withFile(String name, File file) throws FileNotFoundException { if (file == null) { throw new IllegalArgumentException("null file object."); } if (!file.exists() || !file.isFile()) { throw new FileNotFoundException(); } AVFile avFile = new AVFile(); avFile.setLocalPath(file.getAbsolutePath...
AVFile { public static AVFile withFile(String name, File file) throws FileNotFoundException { if (file == null) { throw new IllegalArgumentException("null file object."); } if (!file.exists() || !file.isFile()) { throw new FileNotFoundException(); } AVFile avFile = new AVFile(); avFile.setLocalPath(file.getAbsolutePath...
AVFile { public static AVFile withFile(String name, File file) throws FileNotFoundException { if (file == null) { throw new IllegalArgumentException("null file object."); } if (!file.exists() || !file.isFile()) { throw new FileNotFoundException(); } AVFile avFile = new AVFile(); avFile.setLocalPath(file.getAbsolutePath...
AVFile { public static AVFile withFile(String name, File file) throws FileNotFoundException { if (file == null) { throw new IllegalArgumentException("null file object."); } if (!file.exists() || !file.isFile()) { throw new FileNotFoundException(); } AVFile avFile = new AVFile(); avFile.setLocalPath(file.getAbsolutePath...
@Test public void testRemoveExistTag() { AVSessionCacheHelper.getTagCacheInstance().addSession(testClientId, testClientTag); AVSessionCacheHelper.getTagCacheInstance().removeSession(testClientId); Map<String, String> map = AVSessionCacheHelper.getTagCacheInstance().getAllSession(); Assert.assertTrue(map.size() == 0); }
static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
@Test public void testGetData() throws Exception { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.save(); AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(file.getObjectId()); AVFile newFile = AVFile.withAVObject(object); byte[] byteData = newFile.getData(); As...
@Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (null != d...
AVFile { @Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (...
AVFile { @Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (...
AVFile { @Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (...
AVFile { @Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (...
@Test public void testGetDataNonExistentFile() throws Exception { AVFile file = new AVFile(null, "http: boolean result = false; try { file.getData(); } catch (Exception e) { result = true; } Assert.assertTrue(result); }
@Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (null != d...
AVFile { @Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (...
AVFile { @Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (...
AVFile { @Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (...
AVFile { @Deprecated @JSONField(serialize = false) public byte[] getData() throws AVException { if (!AVUtils.isBlankString(localPath)) { return getLocalFileData(); } else if (!AVUtils.isBlankString(localTmpFilePath)) { return getTmpFileData(); } else if (!AVUtils.isBlankString(url)) { byte[] data = getCacheData(); if (...
@Test public void testGetDataInBackground() throws Exception { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.save(); AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(file.getObjectId()); AVFile newFile = AVFile.withAVObject(object); final CountDownLatch latch ...
public void getDataInBackground(final GetDataCallback dataCallback, final ProgressCallback progressCallback) { if (!AVUtils.isBlankString(localPath)) { if (null != progressCallback) { progressCallback.done(100); } if (dataCallback != null) { dataCallback.internalDone(getLocalFileData(), null); } } else if (!AVUtils.isB...
AVFile { public void getDataInBackground(final GetDataCallback dataCallback, final ProgressCallback progressCallback) { if (!AVUtils.isBlankString(localPath)) { if (null != progressCallback) { progressCallback.done(100); } if (dataCallback != null) { dataCallback.internalDone(getLocalFileData(), null); } } else if (!AV...
AVFile { public void getDataInBackground(final GetDataCallback dataCallback, final ProgressCallback progressCallback) { if (!AVUtils.isBlankString(localPath)) { if (null != progressCallback) { progressCallback.done(100); } if (dataCallback != null) { dataCallback.internalDone(getLocalFileData(), null); } } else if (!AV...
AVFile { public void getDataInBackground(final GetDataCallback dataCallback, final ProgressCallback progressCallback) { if (!AVUtils.isBlankString(localPath)) { if (null != progressCallback) { progressCallback.done(100); } if (dataCallback != null) { dataCallback.internalDone(getLocalFileData(), null); } } else if (!AV...
AVFile { public void getDataInBackground(final GetDataCallback dataCallback, final ProgressCallback progressCallback) { if (!AVUtils.isBlankString(localPath)) { if (null != progressCallback) { progressCallback.done(100); } if (dataCallback != null) { dataCallback.internalDone(getLocalFileData(), null); } } else if (!AV...
@Test public void testGetDataStreamForLargeFile() throws Exception { final String testUrl = "http: AVFile file = new AVFile("jiuzai", testUrl); final CountDownLatch latch = new CountDownLatch(1); file.getDataStreamInBackground(new GetDataStreamCallback() { @Override public void done(InputStream data, AVException e) { i...
public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); }
AVFile { public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); } }
AVFile { public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean exter...
AVFile { public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean exter...
AVFile { public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean exter...
@Test public void testGetDataStreamForExternalFile() throws Exception { final String testUrl = "http: AVFile file = new AVFile("jiuzai", testUrl); final CountDownLatch latch = new CountDownLatch(1); file.getDataStreamInBackground(new GetDataStreamCallback() { @Override public void done(InputStream data, AVException e) ...
public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); }
AVFile { public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); } }
AVFile { public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean exter...
AVFile { public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean exter...
AVFile { public void getDataStreamInBackground(GetDataStreamCallback callback) { getDataStreamInBackground(callback, null); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean exter...
@Test public void testDelete() throws Exception { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.save(); AVFile cloudFile = AVFile.withObjectId(file.getObjectId()); Assert.assertNotNull(cloudFile); Assert.assertEquals(file.getUrl(), cloudFile.getUrl()); file.delete(); AVException exception = null;...
public void delete() throws AVException { if (getFileObject() != null) getFileObject().delete(); else throw AVErrorUtils.createException(AVException.FILE_DELETE_ERROR, "File object is not exists."); }
AVFile { public void delete() throws AVException { if (getFileObject() != null) getFileObject().delete(); else throw AVErrorUtils.createException(AVException.FILE_DELETE_ERROR, "File object is not exists."); } }
AVFile { public void delete() throws AVException { if (getFileObject() != null) getFileObject().delete(); else throw AVErrorUtils.createException(AVException.FILE_DELETE_ERROR, "File object is not exists."); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); pr...
AVFile { public void delete() throws AVException { if (getFileObject() != null) getFileObject().delete(); else throw AVErrorUtils.createException(AVException.FILE_DELETE_ERROR, "File object is not exists."); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); pr...
AVFile { public void delete() throws AVException { if (getFileObject() != null) getFileObject().delete(); else throw AVErrorUtils.createException(AVException.FILE_DELETE_ERROR, "File object is not exists."); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); pr...
@Test public void testDeleteInBackground() throws Exception { AVFile file = new AVFile("name", TEST_FILE_CONTENT.getBytes()); file.save(); AVFile cloudFile = AVFile.withObjectId(file.getObjectId()); Assert.assertNotNull(cloudFile); Assert.assertEquals(file.getUrl(), cloudFile.getUrl()); final CountDownLatch latch = new...
public void deleteInBackground() { if (getFileObject() != null) getFileObject().deleteInBackground(); }
AVFile { public void deleteInBackground() { if (getFileObject() != null) getFileObject().deleteInBackground(); } }
AVFile { public void deleteInBackground() { if (getFileObject() != null) getFileObject().deleteInBackground(); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile...
AVFile { public void deleteInBackground() { if (getFileObject() != null) getFileObject().deleteInBackground(); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile...
AVFile { public void deleteInBackground() { if (getFileObject() != null) getFileObject().deleteInBackground(); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile...
@Test public void testClearCachedFileBeforeDays() throws Exception { AVFile.clearCacheMoreThanDays(6); }
public static void clearCacheMoreThanDays(int days) { long curTime = System.currentTimeMillis(); if ( days > 0) { curTime -= days * 86400000; } String cacheDir = AVFileDownloader.getAVFileCachePath(); clearDir(new File(cacheDir), curTime); }
AVFile { public static void clearCacheMoreThanDays(int days) { long curTime = System.currentTimeMillis(); if ( days > 0) { curTime -= days * 86400000; } String cacheDir = AVFileDownloader.getAVFileCachePath(); clearDir(new File(cacheDir), curTime); } }
AVFile { public static void clearCacheMoreThanDays(int days) { long curTime = System.currentTimeMillis(); if ( days > 0) { curTime -= days * 86400000; } String cacheDir = AVFileDownloader.getAVFileCachePath(); clearDir(new File(cacheDir), curTime); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, Stri...
AVFile { public static void clearCacheMoreThanDays(int days) { long curTime = System.currentTimeMillis(); if ( days > 0) { curTime -= days * 86400000; } String cacheDir = AVFileDownloader.getAVFileCachePath(); clearDir(new File(cacheDir), curTime); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, Stri...
AVFile { public static void clearCacheMoreThanDays(int days) { long curTime = System.currentTimeMillis(); if ( days > 0) { curTime -= days * 86400000; } String cacheDir = AVFileDownloader.getAVFileCachePath(); clearDir(new File(cacheDir), curTime); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, Stri...
@Test public void testClearAllCachedFile() throws Exception { AVFile.clearAllCachedFiles(); }
public static void clearAllCachedFiles() { clearCacheMoreThanDays(0); }
AVFile { public static void clearAllCachedFiles() { clearCacheMoreThanDays(0); } }
AVFile { public static void clearAllCachedFiles() { clearCacheMoreThanDays(0); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); prot...
AVFile { public static void clearAllCachedFiles() { clearCacheMoreThanDays(0); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); prot...
AVFile { public static void clearAllCachedFiles() { clearCacheMoreThanDays(0); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected AVFile(String name, String url, Map<String, Object> metaData, boolean external); AVFile(String name, byte[] data); prot...
@Test public void testRequestSMSCode() throws AVException { AVOSCloud.requestSMSCode(PHONE); }
public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread() { retur...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
@Test public void testTagCacheAdd() { AVSessionCacheHelper.getTagCacheInstance().addSession(testClientId, testClientTag); Map<String, String> clientMap = AVSessionCacheHelper.getTagCacheInstance().getAllSession(); Assert.assertTrue(clientMap.size() == 1); Assert.assertTrue(testClientTag.equals(clientMap.get(testClientI...
static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
@Test public void testRequestSMSCode1() throws AVException { AVOSCloud.requestSMSCode(PHONE, APPLICATION_NAME, OPERATION, TTL); }
public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread() { retur...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
@Test public void testRequestSMSCode2() throws AVException { AVOSCloud.requestSMSCode(PHONE, TEMPLATE_NAME, ENV_MAP); }
public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread() { retur...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
@Test public void testRequestSMSCode3() throws AVException { AVOSCloud.requestSMSCode(PHONE, TEMPLATE_NAME, SIGNATURE_NAME, ENV_MAP); }
public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread() { retur...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
AVSMS { public static void requestSMSCode(String phone, AVSMSOption smsOption) throws AVException { requestSMSCodeInBackground(phone, smsOption, true, new RequestMobileCodeCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread()...
@Test public void testRequestSMSCodeInBackground() throws AVException, InterruptedException { final CountDownLatch latch = new CountDownLatch(1); AVOSCloud.requestSMSCodeInBackground(PHONE, APPLICATION_NAME, OPERATION, TTL, new RequestMobileCodeCallback() { @Override public void done(AVException e) { latch.countDown();...
public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOption o...
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOption o...
@Test public void testRequestSMSCodeInBackground1() throws AVException, InterruptedException { final CountDownLatch latch = new CountDownLatch(1); AVOSCloud.requestSMSCodeInBackground(PHONE, TEMPLATE_NAME, ENV_MAP, new RequestMobileCodeCallback() { @Override public void done(AVException e) { latch.countDown(); } }); la...
public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOption o...
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOption o...
@Test public void testRequestSMSCodeInBackground2() throws AVException, InterruptedException { final CountDownLatch latch = new CountDownLatch(1); AVOSCloud.requestSMSCodeInBackground(PHONE, TEMPLATE_NAME, SIGNATURE_NAME, ENV_MAP, new RequestMobileCodeCallback() { @Override public void done(AVException e) { latch.count...
public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOption o...
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOption o...
@Test public void testRequestSMSCodeInBackground3() throws AVException, InterruptedException { final CountDownLatch latch = new CountDownLatch(1); AVOSCloud.requestSMSCodeInBackground(PHONE, new RequestMobileCodeCallback() { @Override public void done(AVException e) { latch.countDown(); } }); latch.await(); }
public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } }
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOption o...
AVSMS { public static void requestSMSCodeInBackground(String phone, AVSMSOption option, RequestMobileCodeCallback callback) { requestSMSCodeInBackground(phone, option, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOption o...
@Test public void testVerifySMSCode() throws AVException { AVOSCloud.verifySMSCode(CODE, PHONE); }
public static void verifySMSCode(String code, String mobilePhoneNumber) throws AVException { verifySMSCodeInBackground(code, mobilePhoneNumber, true, new AVMobilePhoneVerifyCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnUIThread(...
AVSMS { public static void verifySMSCode(String code, String mobilePhoneNumber) throws AVException { verifySMSCodeInBackground(code, mobilePhoneNumber, true, new AVMobilePhoneVerifyCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnU...
AVSMS { public static void verifySMSCode(String code, String mobilePhoneNumber) throws AVException { verifySMSCodeInBackground(code, mobilePhoneNumber, true, new AVMobilePhoneVerifyCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnU...
AVSMS { public static void verifySMSCode(String code, String mobilePhoneNumber) throws AVException { verifySMSCodeInBackground(code, mobilePhoneNumber, true, new AVMobilePhoneVerifyCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnU...
AVSMS { public static void verifySMSCode(String code, String mobilePhoneNumber) throws AVException { verifySMSCodeInBackground(code, mobilePhoneNumber, true, new AVMobilePhoneVerifyCallback() { @Override public void done(AVException e) { if (e != null) { AVExceptionHolder.add(e); } } @Override public boolean mustRunOnU...
@Test public void testVerifySMSCodeInBackground() throws AVException, InterruptedException { final CountDownLatch latch = new CountDownLatch(1); AVOSCloud.verifySMSCodeInBackground(CODE, PHONE, new AVMobilePhoneVerifyCallback() { @Override public void done(AVException e) { latch.countDown(); } }); latch.await(); }
public static void verifySMSCodeInBackground(String code, String phoneNumber, AVMobilePhoneVerifyCallback callback) { verifySMSCodeInBackground(code, phoneNumber, false, callback); }
AVSMS { public static void verifySMSCodeInBackground(String code, String phoneNumber, AVMobilePhoneVerifyCallback callback) { verifySMSCodeInBackground(code, phoneNumber, false, callback); } }
AVSMS { public static void verifySMSCodeInBackground(String code, String phoneNumber, AVMobilePhoneVerifyCallback callback) { verifySMSCodeInBackground(code, phoneNumber, false, callback); } }
AVSMS { public static void verifySMSCodeInBackground(String code, String phoneNumber, AVMobilePhoneVerifyCallback callback) { verifySMSCodeInBackground(code, phoneNumber, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOptio...
AVSMS { public static void verifySMSCodeInBackground(String code, String phoneNumber, AVMobilePhoneVerifyCallback callback) { verifySMSCodeInBackground(code, phoneNumber, false, callback); } static void requestSMSCode(String phone, AVSMSOption smsOption); static void requestSMSCodeInBackground(String phone, AVSMSOptio...
@Test public void testResetUnreadStatusesCount() throws AVException, InterruptedException { AVUser user = new AVUser(); user.logIn(TestConfig.TEST_USER_NAME, TestConfig.TEST_USER_PWD); final CountDownLatch latch = new CountDownLatch(1); AVStatus.resetUnreadStatusesCount("private", new AVCallback() { @Override protected...
public static void resetUnreadStatusesCount(String inboxType, final AVCallback callback) { if (!checkCurrentUser(null)) { if (callback != null) { callback.internalDone(AVErrorUtils.sessionMissingException()); } return; } final String userId = AVUser.getCurrentUser().getObjectId(); final String endPoint = "subscribe/sta...
AVStatus extends AVObject { public static void resetUnreadStatusesCount(String inboxType, final AVCallback callback) { if (!checkCurrentUser(null)) { if (callback != null) { callback.internalDone(AVErrorUtils.sessionMissingException()); } return; } final String userId = AVUser.getCurrentUser().getObjectId(); final Stri...
AVStatus extends AVObject { public static void resetUnreadStatusesCount(String inboxType, final AVCallback callback) { if (!checkCurrentUser(null)) { if (callback != null) { callback.internalDone(AVErrorUtils.sessionMissingException()); } return; } final String userId = AVUser.getCurrentUser().getObjectId(); final Stri...
AVStatus extends AVObject { public static void resetUnreadStatusesCount(String inboxType, final AVCallback callback) { if (!checkCurrentUser(null)) { if (callback != null) { callback.internalDone(AVErrorUtils.sessionMissingException()); } return; } final String userId = AVUser.getCurrentUser().getObjectId(); final Stri...
AVStatus extends AVObject { public static void resetUnreadStatusesCount(String inboxType, final AVCallback callback) { if (!checkCurrentUser(null)) { if (callback != null) { callback.internalDone(AVErrorUtils.sessionMissingException()); } return; } final String userId = AVUser.getCurrentUser().getObjectId(); final Stri...
@Test public void testUpdateTag() { String updateTag = "updateTag"; AVSessionCacheHelper.getTagCacheInstance().addSession(testClientId, testClientTag); AVSessionCacheHelper.getTagCacheInstance().addSession(testClientId, updateTag); Map<String, String> clientMap = AVSessionCacheHelper.getTagCacheInstance().getAllSession...
static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
AVSessionCacheHelper { static synchronized SessionTagCache getTagCacheInstance() { if (null == tagCacheInstance) { tagCacheInstance = new SessionTagCache(); } return tagCacheInstance; } }
@Test public void testGetEndpoint() { final String objectId = "objectId"; AVUser user = new AVUser(); Assert.assertEquals(AVUser.AVUSER_ENDPOINT, AVPowerfulUtils.getEndpoint(user)); user.setObjectId(objectId); Assert.assertEquals(String.format("%s/%s", AVUser.AVUSER_ENDPOINT, objectId), AVPowerfulUtils.getEndpoint(user...
public static String getEndpoint(String className) { String endpoint = get(className, ENDPOINT); if (AVUtils.isBlankString(endpoint)) { if (!AVUtils.isBlankString(className)) { endpoint = String.format("classes/%s", className); } else { throw new AVRuntimeException("Blank class name"); } } return endpoint; }
AVPowerfulUtils { public static String getEndpoint(String className) { String endpoint = get(className, ENDPOINT); if (AVUtils.isBlankString(endpoint)) { if (!AVUtils.isBlankString(className)) { endpoint = String.format("classes/%s", className); } else { throw new AVRuntimeException("Blank class name"); } } return endp...
AVPowerfulUtils { public static String getEndpoint(String className) { String endpoint = get(className, ENDPOINT); if (AVUtils.isBlankString(endpoint)) { if (!AVUtils.isBlankString(className)) { endpoint = String.format("classes/%s", className); } else { throw new AVRuntimeException("Blank class name"); } } return endp...
AVPowerfulUtils { public static String getEndpoint(String className) { String endpoint = get(className, ENDPOINT); if (AVUtils.isBlankString(endpoint)) { if (!AVUtils.isBlankString(className)) { endpoint = String.format("classes/%s", className); } else { throw new AVRuntimeException("Blank class name"); } } return endp...
AVPowerfulUtils { public static String getEndpoint(String className) { String endpoint = get(className, ENDPOINT); if (AVUtils.isBlankString(endpoint)) { if (!AVUtils.isBlankString(className)) { endpoint = String.format("classes/%s", className); } else { throw new AVRuntimeException("Blank class name"); } } return endp...
@Test public void testConvertCloudResponse() { String content = "{\"result\":{\"content\":\"2222我若是写代码。\",\"ACL\":{\"*\":{\"read\":true},\"59229e282f301e006b1b637e\":{\"read\":true}},\"number\":123,\"userName\":{\"__type\":\"Pointer\",\"className\":\"_User\",\"objectId\":\"59631dab128fe1507271d9b7\"},\"asdfds\":{\"__ty...
public static Object convertCloudResponse(String response) { Object newResultValue = null; try { Map<String, ?> resultMap = AVUtils.getFromJSON(response, Map.class); Object resultValue = resultMap.get("result"); if (resultValue instanceof Collection) { newResultValue = AVUtils.getObjectFrom((Collection) resultValue); }...
AVCloud { public static Object convertCloudResponse(String response) { Object newResultValue = null; try { Map<String, ?> resultMap = AVUtils.getFromJSON(response, Map.class); Object resultValue = resultMap.get("result"); if (resultValue instanceof Collection) { newResultValue = AVUtils.getObjectFrom((Collection) resul...
AVCloud { public static Object convertCloudResponse(String response) { Object newResultValue = null; try { Map<String, ?> resultMap = AVUtils.getFromJSON(response, Map.class); Object resultValue = resultMap.get("result"); if (resultValue instanceof Collection) { newResultValue = AVUtils.getObjectFrom((Collection) resul...
AVCloud { public static Object convertCloudResponse(String response) { Object newResultValue = null; try { Map<String, ?> resultMap = AVUtils.getFromJSON(response, Map.class); Object resultValue = resultMap.get("result"); if (resultValue instanceof Collection) { newResultValue = AVUtils.getObjectFrom((Collection) resul...
AVCloud { public static Object convertCloudResponse(String response) { Object newResultValue = null; try { Map<String, ?> resultMap = AVUtils.getFromJSON(response, Map.class); Object resultValue = resultMap.get("result"); if (resultValue instanceof Collection) { newResultValue = AVUtils.getObjectFrom((Collection) resul...
@Test public void testGetFacebookToken() { String faceBookToken = "facebooktoken"; AVUser user = new AVUser(); user.setFacebookToken(faceBookToken); Assert.assertEquals(user.getFacebookToken(), faceBookToken); }
public String getFacebookToken() { return facebookToken; }
AVUser extends AVObject { public String getFacebookToken() { return facebookToken; } }
AVUser extends AVObject { public String getFacebookToken() { return facebookToken; } AVUser(); AVUser(Parcel in); }
AVUser extends AVObject { public String getFacebookToken() { return facebookToken; } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isEnableAutomatic(); static void disableAutomaticUser(); static synchronized...
AVUser extends AVObject { public String getFacebookToken() { return facebookToken; } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isEnableAutomatic(); static void disableAutomaticUser(); static synchronized...
@Test public void testGetTwitterToken() { String twitterToken = "twitterToken"; AVUser user = new AVUser(); user.setTwitterToken(twitterToken); Assert.assertEquals(user.getTwitterToken(), twitterToken); }
public String getTwitterToken() { return twitterToken; }
AVUser extends AVObject { public String getTwitterToken() { return twitterToken; } }
AVUser extends AVObject { public String getTwitterToken() { return twitterToken; } AVUser(); AVUser(Parcel in); }
AVUser extends AVObject { public String getTwitterToken() { return twitterToken; } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isEnableAutomatic(); static void disableAutomaticUser(); static synchronized v...
AVUser extends AVObject { public String getTwitterToken() { return twitterToken; } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isEnableAutomatic(); static void disableAutomaticUser(); static synchronized v...
@Test public void testGetQqWeiboToken() { String qqWeiboToken = "qqWeiboToken"; AVUser user = new AVUser(); user.setQqWeiboToken(qqWeiboToken); Assert.assertEquals(user.getQqWeiboToken(), qqWeiboToken); }
public String getQqWeiboToken() { return qqWeiboToken; }
AVUser extends AVObject { public String getQqWeiboToken() { return qqWeiboToken; } }
AVUser extends AVObject { public String getQqWeiboToken() { return qqWeiboToken; } AVUser(); AVUser(Parcel in); }
AVUser extends AVObject { public String getQqWeiboToken() { return qqWeiboToken; } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isEnableAutomatic(); static void disableAutomaticUser(); static synchronized v...
AVUser extends AVObject { public String getQqWeiboToken() { return qqWeiboToken; } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isEnableAutomatic(); static void disableAutomaticUser(); static synchronized v...
@Test public void testGetUserQuery() { Assert.assertNotNull(AVUser.getQuery()); }
public static <T extends AVUser> AVQuery<T> getUserQuery(Class<T> clazz) { AVQuery<T> query = new AVQuery<T>(userClassName(), clazz); return query; }
AVUser extends AVObject { public static <T extends AVUser> AVQuery<T> getUserQuery(Class<T> clazz) { AVQuery<T> query = new AVQuery<T>(userClassName(), clazz); return query; } }
AVUser extends AVObject { public static <T extends AVUser> AVQuery<T> getUserQuery(Class<T> clazz) { AVQuery<T> query = new AVQuery<T>(userClassName(), clazz); return query; } AVUser(); AVUser(Parcel in); }
AVUser extends AVObject { public static <T extends AVUser> AVQuery<T> getUserQuery(Class<T> clazz) { AVQuery<T> query = new AVQuery<T>(userClassName(), clazz); return query; } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); ...
AVUser extends AVObject { public static <T extends AVUser> AVQuery<T> getUserQuery(Class<T> clazz) { AVQuery<T> query = new AVQuery<T>(userClassName(), clazz); return query; } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); ...
@Test public void testFriendshipQuery() { AVUser user = new AVUser(); Assert.assertNotNull(user.friendshipQuery()); }
public AVFriendshipQuery friendshipQuery() { return this.friendshipQuery(subClazz == null ? AVUser.class : subClazz); }
AVUser extends AVObject { public AVFriendshipQuery friendshipQuery() { return this.friendshipQuery(subClazz == null ? AVUser.class : subClazz); } }
AVUser extends AVObject { public AVFriendshipQuery friendshipQuery() { return this.friendshipQuery(subClazz == null ? AVUser.class : subClazz); } AVUser(); AVUser(Parcel in); }
AVUser extends AVObject { public AVFriendshipQuery friendshipQuery() { return this.friendshipQuery(subClazz == null ? AVUser.class : subClazz); } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isEnableAutomat...
AVUser extends AVObject { public AVFriendshipQuery friendshipQuery() { return this.friendshipQuery(subClazz == null ? AVUser.class : subClazz); } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isEnableAutomat...
@Test(expected = IllegalArgumentException.class) public void testLogIn_nullName() throws Exception { AVUser.logIn("", ""); }
public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); }
AVUser extends AVObject { public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); } }
AVUser extends AVObject { public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); } AVUser(); AVUser(Parcel in); }
AVUser extends AVObject { public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isE...
AVUser extends AVObject { public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isE...
@Test public void testLogin_wrongPwd() { AVException exception = null; try { AVUser.logIn("fsdfsdffsdffsdfsdf", ""); } catch (AVException e) { exception = e; } Assert.assertNotNull(exception); Assert.assertEquals(exception.getCode(), 211); }
public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); }
AVUser extends AVObject { public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); } }
AVUser extends AVObject { public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); } AVUser(); AVUser(Parcel in); }
AVUser extends AVObject { public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isE...
AVUser extends AVObject { public static AVUser logIn(String username, String password) throws AVException { return logIn(username, password, AVUser.class); } AVUser(); AVUser(Parcel in); String getFacebookToken(); String getTwitterToken(); String getQqWeiboToken(); static void enableAutomaticUser(); static boolean isE...
@Test public void testSignUp() throws AVException { AVUser user = new AVUser(); user.setUsername(UUID.randomUUID().toString()); user.setPassword("test"); user.signUp(); }
private void signUp(boolean sync, final SignUpCallback callback) { if (sync) { try { this.save(); if (callback != null) callback.internalDone(null); } catch (AVException e) { if (callback != null) callback.internalDone(e); } } else { this.saveInBackground(new SaveCallback() { @Override public void done(AVException e) {...
AVUser extends AVObject { private void signUp(boolean sync, final SignUpCallback callback) { if (sync) { try { this.save(); if (callback != null) callback.internalDone(null); } catch (AVException e) { if (callback != null) callback.internalDone(e); } } else { this.saveInBackground(new SaveCallback() { @Override public ...
AVUser extends AVObject { private void signUp(boolean sync, final SignUpCallback callback) { if (sync) { try { this.save(); if (callback != null) callback.internalDone(null); } catch (AVException e) { if (callback != null) callback.internalDone(e); } } else { this.saveInBackground(new SaveCallback() { @Override public ...
AVUser extends AVObject { private void signUp(boolean sync, final SignUpCallback callback) { if (sync) { try { this.save(); if (callback != null) callback.internalDone(null); } catch (AVException e) { if (callback != null) callback.internalDone(e); } } else { this.saveInBackground(new SaveCallback() { @Override public ...
AVUser extends AVObject { private void signUp(boolean sync, final SignUpCallback callback) { if (sync) { try { this.save(); if (callback != null) callback.internalDone(null); } catch (AVException e) { if (callback != null) callback.internalDone(e); } } else { this.saveInBackground(new SaveCallback() { @Override public ...
@Test public void testToJSONObject() throws Exception { String fileName = "FileUnitTestFiles"; AVFile avFile = new AVFile(fileName, TEST_FILE_CONTENT.getBytes()); JSONObject jsonObject = avFile.toJSONObject(); Assert.assertNotNull(jsonObject); Assert.assertEquals(jsonObject.getString("__type"), AVFile.className()); Ass...
protected org.json.JSONObject toJSONObject() { Map<String, Object> data = AVUtils.mapFromFile(this); if (!AVUtils.isBlankString(url)) { data.put("url", url); } return new JSONObject(data); }
AVFile { protected org.json.JSONObject toJSONObject() { Map<String, Object> data = AVUtils.mapFromFile(this); if (!AVUtils.isBlankString(url)) { data.put("url", url); } return new JSONObject(data); } }
AVFile { protected org.json.JSONObject toJSONObject() { Map<String, Object> data = AVUtils.mapFromFile(this); if (!AVUtils.isBlankString(url)) { data.put("url", url); } return new JSONObject(data); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected A...
AVFile { protected org.json.JSONObject toJSONObject() { Map<String, Object> data = AVUtils.mapFromFile(this); if (!AVUtils.isBlankString(url)) { data.put("url", url); } return new JSONObject(data); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected A...
AVFile { protected org.json.JSONObject toJSONObject() { Map<String, Object> data = AVUtils.mapFromFile(this); if (!AVUtils.isBlankString(url)) { data.put("url", url); } return new JSONObject(data); } AVFile(); @Deprecated AVFile(byte[] data); AVFile(String name, String url, Map<String, Object> metaData); protected A...