id
stringlengths
7
14
text
stringlengths
1
106k
3854292_6
public static void main(String[] args) { SpringApplication.run(MujinaIdpApplication.class, args); }
3854292_7
@GetMapping("/SingleSignOnService") public void singleSignOnServiceGet(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, MarshallingException, SignatureException, MessageEncodingException, ValidationException, SecurityException, MessageDecodingException, Meta...
3854292_8
@PostMapping("/SingleSignOnService") public void singleSignOnServicePost(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, MarshallingException, SignatureException, MessageEncodingException, ValidationException, SecurityException, MessageDecodingException, Me...
3854292_9
@Autowired @RequestMapping(method = RequestMethod.GET, value = "/metadata", produces = "application/xml") public String metadata(@Value("${idp.base_url}") String idpBaseUrl) throws SecurityException, ParserConfigurationException, SignatureException, MarshallingException, TransformerException { EntityDescriptor entity...
3859251_0
public synchronized boolean isConnected() { (!super.isConnected()) // if we haven't been connected at all, don't bother with // the NOOP. return false; { if (port == null) rt = getPort(null); else if (!port.noop()) row new IOException("NOOP failed"); return true; atch (IOException ioex) { // no longer connected...
3859251_1
public static int getIntSessionProperty(Session session, String name, int def) { urn getInt(getProp(session.getProperties(), name), def); }
3859251_2
public static int getIntSessionProperty(Session session, String name, int def) { urn getInt(getProp(session.getProperties(), name), def); }
3859251_3
public static int getIntSessionProperty(Session session, String name, int def) { urn getInt(getProp(session.getProperties(), name), def); }
3859251_4
public static int getIntSessionProperty(Session session, String name, int def) { urn getInt(getProp(session.getProperties(), name), def); }
3859251_5
public static boolean getBooleanSessionProperty(Session session, String name, boolean def) { urn getBoolean(getProp(session.getProperties(), name), def); }
3859251_6
public static boolean getBooleanSessionProperty(Session session, String name, boolean def) { urn getBoolean(getProp(session.getProperties(), name), def); }
3859251_7
public static boolean getBooleanSessionProperty(Session session, String name, boolean def) { urn getBoolean(getProp(session.getProperties(), name), def); }
3859251_8
public static boolean getBooleanSessionProperty(Session session, String name, boolean def) { urn getBoolean(getProp(session.getProperties(), name), def); }
3859251_9
public static int getIntSessionProperty(Session session, String name, int def) { urn getInt(getProp(session.getProperties(), name), def); }
3869967_0
@Override public ListenableFuture<UploadedImage> upload(final String namespace, final String imageId, final String styleCode, final String styleVariant, final String extension, final File file, final String contentType) { // sanity check Preconditions.checkArgument(!Strings.isNullOrEmpty(contentType), "Cannot upl...
3869967_1
@Override public ListenableFuture<List<UploadedImage>> transform(final ImageConnector source, final File sourceFile, final String namespace, final String imageId, final ImageVariant sourceVariant, final Map<ImageTransform, ImageVariant> transforms) { final AsyncFunction<File, List<UploadedImage>> processor = new As...
3869967_2
@Override public ListenableFuture<List<UploadedImage>> transform(final ImageConnector source, final File sourceFile, final String namespace, final String imageId, final ImageVariant sourceVariant, final Map<ImageTransform, ImageVariant> transforms) { final AsyncFunction<File, List<UploadedImage>> processor = new As...
3869967_3
@Override public ListenableFuture<List<UploadedImage>> transform(final ImageConnector source, final File sourceFile, final String namespace, final String imageId, final ImageVariant sourceVariant, final Map<ImageTransform, ImageVariant> transforms) { final AsyncFunction<File, List<UploadedImage>> processor = new As...
3869967_4
@Override public ListenableFuture<List<UploadedImage>> transform(final ImageConnector source, final File sourceFile, final String namespace, final String imageId, final ImageVariant sourceVariant, final Map<ImageTransform, ImageVariant> transforms) { final AsyncFunction<File, List<UploadedImage>> processor = new As...
3869967_5
@Override public ListenableFuture<List<UploadedImage>> transform(final ImageConnector source, final File sourceFile, final String namespace, final String imageId, final ImageVariant sourceVariant, final Map<ImageTransform, ImageVariant> transforms) { final AsyncFunction<File, List<UploadedImage>> processor = new As...
3869967_6
@Override public Page<City> searchCity(String term, Pageable pageable) { / // http://stackoverflow.com/a/3322174/1343587 / final String normalizedTerm = Normalizer.normalize(term, Form.NFD).replaceAll("[^\\p{ASCII}]", "").toLowerCase(); / final Iterable<CharSequence> keys = tree.getKeysStartingWith(normalizedTerm); ...
3869967_7
@Override public Page<City> searchCity(String term, Pageable pageable) { / // http://stackoverflow.com/a/3322174/1343587 / final String normalizedTerm = Normalizer.normalize(term, Form.NFD).replaceAll("[^\\p{ASCII}]", "").toLowerCase(); / final Iterable<CharSequence> keys = tree.getKeysStartingWith(normalizedTerm); ...
3869967_8
@Override public Country getCountry(String iso2orIso3) throws IllegalArgumentException { return countryRepo.getCountry(iso2orIso3); }
3869967_9
@Override public Page<City> searchCity(String term, Pageable pageable) { / // http://stackoverflow.com/a/3322174/1343587 / final String normalizedTerm = Normalizer.normalize(term, Form.NFD).replaceAll("[^\\p{ASCII}]", "").toLowerCase(); / final Iterable<CharSequence> keys = tree.getKeysStartingWith(normalizedTerm); ...
3885169_0
public List<Comment> getResultList() { log.info("get result list"); return commentDao.findComments(blogEntryService.getInstance()); }
3885169_1
public boolean delete() { log.info("delete blog entry " + instance); blogEntryDao.remove(instance); end(); return true; }
3885169_2
public List<BlogEntry> getResultList() { log.info("load blog entries"); if (resultList == null) { resultList = blogEntryDao.find(MAX_RESULTS, firstResult); } return resultList; }
3885169_3
public boolean login() { User user = userDao.findByUsername(username); if (user != null && user.verifyPassword(password)) { identity.setLoggedIn(true); identity.setUser(user); return true; } return false; }
3885169_4
public boolean logout() { log.info("logout current user"); session.invalidate(); return true; }
3885169_5
public boolean verifyPassword(String password) { return new BasicPasswordEncryptor().checkPassword(password, this.password); }
3885169_6
public void setAuthor(User author) { this.author = author; }
3894929_0
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_1
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_2
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_3
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_4
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_5
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_6
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_7
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_8
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3894929_9
public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); }
3900538_0
public static boolean invokeFunction(List<Decoder<? extends Object, ?>> decoders, List<FunctionWrapper> functions, Class<?> implementedType, Object instanceType, String fun...
3900538_1
public static boolean invokeFunction(List<Decoder<? extends Object, ?>> decoders, List<FunctionWrapper> functions, Class<?> implementedType, Object instanceType, String fun...
3900538_2
@Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decoded<List<String>>(new LinkedList<String>()); message = messagesBuffer.append(message).to...
3900538_3
@Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decoded<List<String>>(new LinkedList<String>()); message = messagesBuffer.append(message).to...
3900538_4
@Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decoded<List<String>>(new LinkedList<String>()); message = messagesBuffer.append(message).to...
3900538_5
@Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decoded<List<String>>(new LinkedList<String>()); message = messagesBuffer.append(message).to...
3900538_6
@Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decoded<List<String>>(new LinkedList<String>()); message = messagesBuffer.append(message).to...
3900538_7
@Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decoded<List<String>>(new LinkedList<String>()); message = messagesBuffer.append(message).to...
3900538_8
@Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decoded<List<String>>(new LinkedList<String>()); message = messagesBuffer.append(message).to...
3900538_9
@Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decoded<List<String>>(new LinkedList<String>()); message = messagesBuffer.append(message).to...
3910894_0
@Override public final Collection<Song> getAllSongs() throws IOException, URISyntaxException { final Collection<Song> chunkedCollection = new ArrayList<Song>(); // Map<String, String> fields = new HashMap<String, String>(); // fields.put("json", "{\"continuationToken\":\"" + continuationToken + ...
3910894_1
@Override public final Collection<Song> getAllSongs() throws IOException, URISyntaxException { final Collection<Song> chunkedCollection = new ArrayList<Song>(); // Map<String, String> fields = new HashMap<String, String>(); // fields.put("json", "{\"continuationToken\":\"" + continuationToken + ...
3910894_2
@Override public final Collection<Song> getAllSongs() throws IOException, URISyntaxException { final Collection<Song> chunkedCollection = new ArrayList<Song>(); // Map<String, String> fields = new HashMap<String, String>(); // fields.put("json", "{\"continuationToken\":\"" + continuationToken + ...
3913468_0
@Override public Map<String,String> getProperties() { Map<String,String> envVars = System.getenv(); if (!Collections.isEmpty(envVars)) { return new LinkedHashMap<String, String>(envVars); } return java.util.Collections.emptyMap(); }
3913468_1
@Override public Map<String,String> getProperties() { Map<String,String> envVars = System.getenv(); if (!Collections.isEmpty(envVars)) { return new LinkedHashMap<String, String>(envVars); } return java.util.Collections.emptyMap(); }
3933009_0
public static List<Map<String, String>> getSortedExperiences(Profile currentProfile) { List<Map<String, String>> experiences = getMultiValues(currentProfile, Profile.EXPERIENCES); if (experiences != null) { Collections.sort(experiences, Comparator.comparing(UserProfileHelper::isCurrent).thenComparing(UserProfil...
3933009_1
public static Map<String, String> escapeExperience(Map<String, String> experience) { Map<String, String> escapedExperience = new LinkedHashMap<>(); putExperienceData(experience, escapedExperience, Profile.EXPERIENCES_ID); putExperienceData(experience, escapedExperience, Profile.EXPERIENCES_COMPANY); putExperien...
3933009_2
@Override public void onUpdateProfile(Profile profile) throws MessageException { new UpdateProfileProcess(profile).doUpdate(); }
3933009_3
@Override public void onUpdateProfile(Profile profile) throws MessageException { new UpdateProfileProcess(profile).doUpdate(); }
3933009_4
@Override public boolean hasPermission(Identity userIdentity, Group group) { if (userACL.getSuperUser().equals(userIdentity.getUserId()) || userIdentity.getMemberships() .stream() .anyMatch(userMembership -> userMembership.getGroup().equals(userACL.getAdminGroups()))) {...
3933009_5
@Override public boolean hasPermission(Identity userIdentity, Group group) { if (userACL.getSuperUser().equals(userIdentity.getUserId()) || userIdentity.getMemberships() .stream() .anyMatch(userMembership -> userMembership.getGroup().equals(userACL.getAdminGroups()))) {...
3933009_6
@Override public boolean hasPermission(Identity userIdentity, Group group) { if (userACL.getSuperUser().equals(userIdentity.getUserId()) || userIdentity.getMemberships() .stream() .anyMatch(userMembership -> userMembership.getGroup().equals(userACL.getAdminGroups()))) {...
3934425_0
@Override public void put(K name, V obj) { super.put(name, obj); try { rpcService.executeCommandOnAllNodes(command, false, id, "p", name, obj); } catch (Exception e) { LOG.warn("Could not put the entry " + name + " on other cluster nodes", e); } }
3934425_1
@Override public void putMap(Map<? extends K, ? extends V> objs) { super.putMap(objs); try { rpcService.executeCommandOnAllNodes(command, false, id, "m", new HashMap<K, V>(objs)); } catch (Exception e) { LOG.warn("Could not put entries on other cluster nodes", e); } }
3934425_2
@Override public V remove(Serializable name) { V v = super.remove(name); if (v != null) { try { rpcService.executeCommandOnAllNodes(command, false, id, "r", name); } catch (Exception e) { LOG.warn("Could not remove the entry " + name + " on other cluster nodes", ...
3934425_3
@Override public void clearCache() { super.clearCache(); try { rpcService.executeCommandOnAllNodes(command, false, id, "c"); } catch (Exception e) { LOG.warn("Could not clear the cache on other cluster nodes", e); } }
3934425_4
public void put(K name, V obj) { if (name == null) { throw new IllegalArgumentException("No null cache key accepted"); } if (liveTimeMillis != 0) { long expirationTime = liveTimeMillis > 0 ? System.currentTimeMillis() + liveTimeMillis : Long.MAX_VALUE; state.put(expirationTime, name, ob...
3934425_5
public ArrayList<I> trim(int size) { if (trimming.compareAndSet(false, true)) { try { queueLock.lock(); if (queueSize > size) { ArrayList<I> evictedItems = new ArrayList<I>(queueSize - size); while (queueSize > size) { I las...
3934425_6
public static boolean hasProfileInProperty(String profileName) { return getProfilesFromProperty().contains(profileName); }
3934425_7
public <T> T getComponentInstanceOfType(Class<T> componentType) { return getComponentInstanceOfType(componentType, true); }
3934425_8
public <T> T getComponentInstanceOfType(Class<T> componentType) { return getComponentInstanceOfType(componentType, true); }
3934425_9
public <T> T getComponentInstanceOfType(Class<T> componentType) { return getComponentInstanceOfType(componentType, true); }
3935296_0
public void registerBBCodePlugin(BBCodePlugin plugin) throws Exception { plugins.add(plugin); }
3935296_1
public void initDefaultBBCodes() throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); try { Node bbCodeHome = getBBcodeHome(sProvider); NodeIterator iter = bbCodeHome.getNodes(); if (iter.getSize() <= 0) { List<BBCode> bbCodes = new ArrayList<BBCode>(); for ...
3935296_2
public void save(List<BBCode> bbcodes) throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); try { Node bbCodeHome = getBBcodeHome(sProvider); Node bbcNode; for (BBCode bbcode : bbcodes) { bbcNode = createNode(bbCodeHome, bbcode); bbcNode.setProperty("exo:tag...
3935296_3
public List<BBCode> getAll() throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); List<BBCode> bbcodes = new ArrayList<BBCode>(); try { Node bbCodeHome = getBBcodeHome(sProvider); NodeIterator iter = bbCodeHome.getNodes(); while (iter.hasNext()) { try { ...
3935296_4
public List<String> getActive() throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); if (activeBBCodesCache.isEmpty()) { try { Node bbCodeHome = getBBcodeHome(sProvider); if (bbCodeHome == null) { return activeBBCodesCache; } QueryManager qm = bb...
3935296_5
public BBCode findById(String id) throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); BBCode bbCode = new BBCode(); Node bbcNode; try { Node bbCodeHome = getBBcodeHome(sProvider); try { bbcNode = bbCodeHome.getNode(id); bbCode = nodeToBBCode(bbcNode); }...
3935296_6
public void delete(String bbcodeId) throws Exception { SessionProvider sProvider = SessionProvider.createSystemProvider(); Node bbCodeHome = getBBcodeHome(sProvider); try { bbCodeHome.getNode(bbcodeId).remove(); bbCodeHome.save(); synchronized (activeBBCodesCache) { activeBBCodesCache.clear(); ...
3935296_7
public static boolean hasPermission(String[] userGroupMembership, String userId) throws Exception { IdentityRegistry identityRegistry = (IdentityRegistry) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(IdentityRegistry.class); Identity identity = identityRegistry.getIdentity(userId); if (ide...
3935296_8
@SuppressWarnings("unchecked") public static List<String> getUserPermission(String[] userGroupMembership) throws Exception { List<String> users = getFromCache(userGroupMembership); if (users != null) { return users; } users = new ArrayList<String>(); if (userGroupMembership == null || userGroupMembership....
3935296_9
@SuppressWarnings("unchecked") public static List<String> getUserPermission(String[] userGroupMembership) throws Exception { List<String> users = getFromCache(userGroupMembership); if (users != null) { return users; } users = new ArrayList<String>(); if (userGroupMembership == null || userGroupMembership....
3935748_0
private DriveItem getRoot() { return graphClient.me().drive().root().buildRequest().get(); }
3935748_1
public User getUser() { return graphClient.me().buildRequest().get(); }
3935748_2
public DriveItem insert(String parentId, String fileName, Calendar created, Calendar modified, InputStream inputStream, String conflictBehavior) throws OneDriveException { if (LOG.isDebugEnabled()) { LOG.debug("insert file"); } String updateUploadUrl = null; try { updateUploadUrl = getInsertUploadUrl(pa...
3935748_3
public DriveItem insert(String parentId, String fileName, Calendar created, Calendar modified, InputStream inputStream, String conflictBehavior) throws OneDriveException { if (LOG.isDebugEnabled()) { LOG.debug("insert file"); } String updateUploadUrl = null; try { updateUploadUrl = getInsertUploadUrl(pa...
3935748_4
public DriveItem createFolder(String parentId, String name, Calendar created) { if (parentId == null || parentId.isEmpty()) { parentId = getRootId(); } DriveItem folder = new DriveItem(); folder.name = name; folder.parentReference = new ItemReference(); folder.fileSystemInfo = new FileSystemInfo(); fo...
3935748_5
public DriveItem createFolder(String parentId, String name, Calendar created) { if (parentId == null || parentId.isEmpty()) { parentId = getRootId(); } DriveItem folder = new DriveItem(); folder.name = name; folder.parentReference = new ItemReference(); folder.fileSystemInfo = new FileSystemInfo(); fo...
3935748_6
public void removeFile(String fileId) { graphClient.me().drive().items(fileId).buildRequest().delete(); }
3935748_7
public ChildIterator getChildIterator(String folderId) { return new ChildIterator(folderId); }
3935748_8
public SharingLink createLink(String itemId, String type) throws OneDriveException { if (type.equalsIgnoreCase("embed")) { return graphClient.me().drive().items(itemId).createLink("embed", "anonymous").buildRequest().post().link; } else if (type.equalsIgnoreCase("view")) { return graphClient.me().drive().it...
3935748_9
public DriveItem getItem(String itemId) { return graphClient.me().drive().items(itemId).buildRequest().get(); }
3937364_0
@Override public void processUpgrade(String oldVersion, String newVersion) { SessionProvider sessionProvider = SessionProvider.createSystemProvider(); migrateCollaboration(sessionProvider); migrateGadgets(sessionProvider); migrateUsers(sessionProvider); migrateLoginHistory(sessionProvider); sessionProvider....
3937364_1
@Override public void processUpgrade(String oldVersion, String newVersion) { try { //Force remove digest items only source migration version is after 5.2.0 //Before this version, there is no problem of blocking digest, so no need of delete it if (VersionComparator.isAfter(oldVersion, "5.2.0") || ...
3937364_2
@Override public void processUpgrade(String oldVersion, String newVersion) { try { //Force remove digest items only source migration version is after 5.2.0 //Before this version, there is no problem of blocking digest, so no need of delete it if (VersionComparator.isAfter(oldVersion, "5.2.0") || ...
3937364_3
@Override public void processUpgrade(String oldVersion, String newVersion) { try { //Force remove digest items only source migration version is after 5.2.0 //Before this version, there is no problem of blocking digest, so no need of delete it if (VersionComparator.isAfter(oldVersion, "5.2.0") || ...
3937364_4
public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySetupSkip == null) { LOG.debug("Prop...
3937364_5
public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySetupSkip == null) { LOG.debug("Prop...
3937364_6
public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySetupSkip == null) { LOG.debug("Prop...