repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/events/RefReplicatedEvent.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // static String resolveNodeName(URIish uri) { // StringBuilder sb = new StringBuilder(); // if (uri.isRemote()) { // sb.append(uri.getHost()); // if (uri.getPort() != -1) { // sb.append(":"); // sb.appe...
import static com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName; import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult; import java.util.Objects; import org.eclipse.jgit.transport.RemoteRefUpdate; import org.eclipse.jgit.transport.RemoteRefUpdate.Status; import...
// Copyright (C) 2013 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // static String resolveNodeName(URIish uri) { // StringBuilder sb = new StringBuilder(); // if (uri.isRemote()) { // sb.append(uri.getHost()); // if (uri.getPort() != -1) { // sb.append(":"); // sb.appe...
this.targetNode = resolveNodeName(targetUri);
GerritCodeReview/plugins_replication
src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationStorageIT.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java // public static class QueueInfo { // public final Map<URIish, PushOne> pending; // public final Map<URIish, PushOne> inFlight; // // public QueueInfo(Map<URIish, PushOne> pending, Map<URIish, PushOne> inFlight) { // this.pen...
import static com.google.common.truth.Truth.assertThat; import static com.googlesource.gerrit.plugins.replication.PushResultProcessing.NO_OP; import com.google.gerrit.acceptance.TestPlugin; import com.google.gerrit.acceptance.UseLocalDisk; import com.google.gerrit.acceptance.WaitUtil; import com.google.gerrit.entities....
@Test public void shouldCleanupBothTasksAndLocksAfterNewProjectReplication() throws Exception { setReplicationDestination("task_cleanup_locks_project", "replica", ALL_PROJECTS); config.setInt("remote", "task_cleanup_locks_project", "replicationRetry", 0); config.save(); reloadConfig(); assertTh...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java // public static class QueueInfo { // public final Map<URIish, PushOne> pending; // public final Map<URIish, PushOne> inFlight; // // public QueueInfo(Map<URIish, PushOne> pending, Map<URIish, PushOne> inFlight) { // this.pen...
destinationCollection.getAll(FilterType.ALL).stream()
GerritCodeReview/plugins_replication
src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationStorageIT.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java // public static class QueueInfo { // public final Map<URIish, PushOne> pending; // public final Map<URIish, PushOne> inFlight; // // public QueueInfo(Map<URIish, PushOne> pending, Map<URIish, PushOne> inFlight) { // this.pen...
import static com.google.common.truth.Truth.assertThat; import static com.googlesource.gerrit.plugins.replication.PushResultProcessing.NO_OP; import com.google.gerrit.acceptance.TestPlugin; import com.google.gerrit.acceptance.UseLocalDisk; import com.google.gerrit.acceptance.WaitUtil; import com.google.gerrit.entities....
() -> isTaskRescheduled(destination.getQueueInfo(), urish), TEST_NEW_PROJECT_TIMEOUT); // replicationRetry is set to 1 minute which is the minimum value. That's why // should be safe to get the pushOne object from pending because it should be // here for one minute PushOne pushOp = destination.g...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java // public static class QueueInfo { // public final Map<URIish, PushOne> pending; // public final Map<URIish, PushOne> inFlight; // // public QueueInfo(Map<URIish, PushOne> pending, Map<URIish, PushOne> inFlight) { // this.pen...
private boolean isTaskRescheduled(QueueInfo queue, URIish uri) {
GerritCodeReview/plugins_replication
src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfigTest.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationConfig.java // enum FilterType { // PROJECT_CREATION, // PROJECT_DELETION, // ALL // }
import static com.google.common.truth.Truth.assertThat; import com.googlesource.gerrit.plugins.replication.ReplicationConfig.FilterType; import java.io.IOException; import java.util.List; import org.eclipse.jgit.storage.file.FileBasedConfig; import org.junit.Test;
// Copyright (C) 2019 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationConfig.java // enum FilterType { // PROJECT_CREATION, // PROJECT_DELETION, // ALL // } // Path: src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfigTest.java import static com.google.common.truth.Truth....
List<Destination> destinations = destinationsCollections.getAll(FilterType.ALL);
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/OnStartStop.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // public static class GitUpdateProcessing implements PushResultProcessing { // private static final FluentLogger logger = FluentLogger.forEnclosingClass(); // // private final EventDispatcher dispatcher; // // public G...
import com.google.common.util.concurrent.Atomics; import com.google.gerrit.extensions.events.LifecycleListener; import com.google.gerrit.extensions.registration.DynamicItem; import com.google.gerrit.extensions.systemstatus.ServerInformation; import com.google.gerrit.server.events.EventDispatcher; import com.google.inje...
// Copyright (C) 2012 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // public static class GitUpdateProcessing implements PushResultProcessing { // private static final FluentLogger logger = FluentLogger.forEnclosingClass(); // // private final EventDispatcher dispatcher; // // public G...
ReplicationState state = new ReplicationState(new GitUpdateProcessing(eventDispatcher.get()));
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/events/ReplicationScheduledEvent.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // static String resolveNodeName(URIish uri) { // StringBuilder sb = new StringBuilder(); // if (uri.isRemote()) { // sb.append(uri.getHost()); // if (uri.getPort() != -1) { // sb.append(":"); // sb.appe...
import static com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName; import com.google.gerrit.entities.Project; import org.eclipse.jgit.transport.URIish;
// Copyright (C) 2016 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // static String resolveNodeName(URIish uri) { // StringBuilder sb = new StringBuilder(); // if (uri.isRemote()) { // sb.append(uri.getHost()); // if (uri.getPort() != -1) { // sb.append(":"); // sb.appe...
this.targetNode = resolveNodeName(targetUri);
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME);
import static com.google.common.base.Suppliers.memoize; import static com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; import com.google.gerrit.server.config.ConfigUtil; import java.util.concurrent.TimeUnit; i...
remoteNameStyle = MoreObjects.firstNonNull(cfg.getString("remote", name, "remoteNameStyle"), "slash"); maxRetries = getInt( remoteConfig, cfg, "replicationMaxRetries", cfg.getInt("replication", "maxRetries", 0)); slowLatencyThreshold = (int) ConfigUtil.getTim...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java import static com.google.common.base.Sup...
repLog.atWarning().log(
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/GetAccountController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
import com.webpagebytes.wpbsample.data.Session; import java.sql.SQLException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.w...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/GetAccountController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
import com.webpagebytes.wpbsample.data.Session; import java.sql.SQLException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.w...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
Account account = database.getAccount(user_id);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ConfirmEmailController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/User.java // public class User { // private String userName; // private Integer receiveNewsletter; // private String email; // private Integer id; // private String password; // private Date open_date; // private Integer confirmEmailFlag; // private...
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.User;
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/User.java // public class User { // private String userName; // private Integer receiveNewsletter; // private String email; // private Integer id; // private String password; // private Date open_date; // private Integer confirmEmailFlag; // private...
User user = null;
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/LoginController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.User; import com.webpagebytes.wpbsample.utility.HashService; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import j...
{ String username = request.getParameter("username"); String password = request.getParameter("password"); if (username.length() == 0 || username.length() > 255) { errors.put("username", "Error.username.length"); } else if (!username.matches("[0-9a-zA-Z_@.-]*")) { errors.put("username", "E...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/LoginController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.User; import com.webpagebytes.wpbsample.utility.HashService; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import j...
HttpServletResponse response, WPBModel model, WPBForward forward) throws WPBException { Session session = getSession(request, response); session.getSessionMap().clear(); session.setUser_id(null); try { database.setSession(session); } catch (SQLException e) { throw new WPBException("Ca...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
User user = null;
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/LoginController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.User; import com.webpagebytes.wpbsample.utility.HashService; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import j...
if (errors.size() >0) { model.getCmsApplicationModel().put("values", values); String regPageKey = model.getCmsModel().get(WPBModel.GLOBALS_KEY).get("LOGIN_PAGE_KEY"); forward.setForwardTo(regPageKey); return; } User user = null; try { user = database.getUser(username); } c...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
hashUser = HashService.getHashSha1(password.getBytes());
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/GetProfileController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import java.sql.SQLException; import java.util.HashMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample....
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/GetProfileController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import java.sql.SQLException; import java.util.HashMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample....
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
User user = database.getUser(user_id);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/NotificationImageController.java
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleFopService.java // public class SampleFopService { // // private static SampleFopService instance; // private FopFactory fopFactory; // private TransformerFactory transformerFactory; // private static volatile Object lock = new Object(); // /...
import com.webpagebytes.wpbsample.utility.SampleFopService; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; import org.apache....
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleFopService.java // public class SampleFopService { // // private static SampleFopService instance; // private FopFactory fopFactory; // private TransformerFactory transformerFactory; // private static volatile Object lock = new Object(); // /...
SampleFopService fopService = SampleFopService.getInstance();
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/GenericController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.wpbsample.data.Session; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException;
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
HttpServletResponse response, WPBModel model, WPBForward forward, Session session) {
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/SuccessDWController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
import java.sql.SQLException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Account; import com.w...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/SuccessDWController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
import java.sql.SQLException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Account; import com.w...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
DepositWithdrawal operation = database.getDepositOrWithdrawal(id);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/SuccessDWController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
import java.sql.SQLException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Account; import com.w...
return; } Integer user_id = (Integer) session.getSessionMap().get(SESSION_LOGIN_USERID); try { String idStr = request.getParameter("id"); Long id = 0L; try { id = Long.valueOf(idStr); } catch (NumberFormatException e) { id = null; } if (id == null) { ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
Account account = database.getAccount(user_id);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/AccountStatementPDFController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.utility.SampleFopService; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import o...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/AccountStatementPDFController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.utility.SampleFopService; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import o...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
SampleFopService fopService = SampleFopService.getInstance();
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/LogoutController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import java.io.IOException; import java.sql.SQLException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsampl...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ReportTransactionsController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.Transaction; import com.webpagebytes.wpbsample.utility.DateUtility; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; ...
interval = Integer.valueOf(intervalStr); } catch (NumberFormatException e) { // do nothing, go with the default } switch (interval) { case 1: case 7: case 30: break; default: interval = 1; } return interval; } public void handleRequest(HttpServletRequest ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
Date past = DateUtility.addDays(new Date(), -interval);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ReportTransactionsController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.Transaction; import com.webpagebytes.wpbsample.utility.DateUtility; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; ...
} Integer user_id = (Integer) session.getSessionMap().get(SESSION_LOGIN_USERID); int interval = getInterval(model); Date past = DateUtility.addDays(new Date(), -interval); List<Date> dates = new ArrayList<Date>(); List<String> keys = new ArrayList<String>(); Map<String, Long> receiveAmo...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
List<Transaction> transactions = database.getTransactionsForUser(user_id, past, 1, MAX_RECORDS);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/WPBSampleContextListener.java
// Path: src/main/java/com/webpagebytes/wpbsample/utility/PathUtility.java // public class PathUtility { // // public static String safePath(String path) // { // if (path != null) // { // return path.replace('/', File.separatorChar).replace('\\', File.separatorChar); // ...
import static org.quartz.CronScheduleBuilder.*; import static org.quartz.JobBuilder.*; import com.webpagebytes.cms.WPBContentServiceFactory; import com.webpagebytes.wpbsample.utility.PathUtility; import com.webpagebytes.wpbsample.utility.SampleConfigurator; import com.webpagebytes.wpbsample.utility.SampleFopServic...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/utility/PathUtility.java // public class PathUtility { // // public static String safePath(String path) // { // if (path != null) // { // return path.replace('/', File.separatorChar).replace('\\', File.separatorChar); // ...
sampleConfigPath = PathUtility.safePath(sampleConfigPath);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/WPBSampleContextListener.java
// Path: src/main/java/com/webpagebytes/wpbsample/utility/PathUtility.java // public class PathUtility { // // public static String safePath(String path) // { // if (path != null) // { // return path.replace('/', File.separatorChar).replace('\\', File.separatorChar); // ...
import static org.quartz.CronScheduleBuilder.*; import static org.quartz.JobBuilder.*; import com.webpagebytes.cms.WPBContentServiceFactory; import com.webpagebytes.wpbsample.utility.PathUtility; import com.webpagebytes.wpbsample.utility.SampleConfigurator; import com.webpagebytes.wpbsample.utility.SampleFopServic...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/utility/PathUtility.java // public class PathUtility { // // public static String safePath(String path) // { // if (path != null) // { // return path.replace('/', File.separatorChar).replace('\\', File.separatorChar); // ...
SampleConfigurator.initialize(sampleConfigPath);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/WPBSampleContextListener.java
// Path: src/main/java/com/webpagebytes/wpbsample/utility/PathUtility.java // public class PathUtility { // // public static String safePath(String path) // { // if (path != null) // { // return path.replace('/', File.separatorChar).replace('\\', File.separatorChar); // ...
import static org.quartz.CronScheduleBuilder.*; import static org.quartz.JobBuilder.*; import com.webpagebytes.cms.WPBContentServiceFactory; import com.webpagebytes.wpbsample.utility.PathUtility; import com.webpagebytes.wpbsample.utility.SampleConfigurator; import com.webpagebytes.wpbsample.utility.SampleFopServic...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/utility/PathUtility.java // public class PathUtility { // // public static String safePath(String path) // { // if (path != null) // { // return path.replace('/', File.separatorChar).replace('\\', File.separatorChar); // ...
SampleFopService.getInstance();
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/database/WPBDatabaseService.java
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleConfigurator.java // public class SampleConfigurator { // // private Properties properties; // private static SampleConfigurator instance; // // private SampleConfigurator() {}; // // public static void initialize(String configPath) throws ...
import java.util.HashMap; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import com.webpagebytes.wpbsample.utility.SampleConfigurator;
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleConfigurator.java // public class SampleConfigurator { // // private Properties properties; // private static SampleConfigurator instance; // // private SampleConfigurator() {}; // // public static void initialize(String configPath) throws ...
SampleConfigurator configurator = SampleConfigurator.getInstance();
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ReportDWController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/DepositWithdrawal.java // public class DepositWithdrawal { // public enum OperationType // { // DEPOSIT, // WITHDRAWAL // }; // private long id; // private OperationType type; // private int user_id; // private long amount; // private Date dat...
import com.webpagebytes.wpbsample.data.DepositWithdrawal; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.DepositWithdrawal.OperationType; import com.webpagebytes.wpbsample.utility.DateUtility; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayLi...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/DepositWithdrawal.java // public class DepositWithdrawal { // public enum OperationType // { // DEPOSIT, // WITHDRAWAL // }; // private long id; // private OperationType type; // private int user_id; // private long amount; // private Date dat...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ReportDWController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/DepositWithdrawal.java // public class DepositWithdrawal { // public enum OperationType // { // DEPOSIT, // WITHDRAWAL // }; // private long id; // private OperationType type; // private int user_id; // private long amount; // private Date dat...
import com.webpagebytes.wpbsample.data.DepositWithdrawal; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.DepositWithdrawal.OperationType; import com.webpagebytes.wpbsample.utility.DateUtility; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayLi...
interval = Integer.valueOf(intervalStr); } catch (NumberFormatException e) { // do nothing, go with the default } switch (interval) { case 1: case 7: case 30: break; default: interval = 1; } return interval; } public void handleRequest(HttpServletRequest ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/DepositWithdrawal.java // public class DepositWithdrawal { // public enum OperationType // { // DEPOSIT, // WITHDRAWAL // }; // private long id; // private OperationType type; // private int user_id; // private long amount; // private Date dat...
Date past = DateUtility.addDays(new Date(), -interval);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ReportDWController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/DepositWithdrawal.java // public class DepositWithdrawal { // public enum OperationType // { // DEPOSIT, // WITHDRAWAL // }; // private long id; // private OperationType type; // private int user_id; // private long amount; // private Date dat...
import com.webpagebytes.wpbsample.data.DepositWithdrawal; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.DepositWithdrawal.OperationType; import com.webpagebytes.wpbsample.utility.DateUtility; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayLi...
Integer user_id = (Integer) session.getSessionMap().get(SESSION_LOGIN_USERID); int interval = getInterval(model); Date past = DateUtility.addDays(new Date(), -interval); List<Date> dates = new ArrayList<Date>(); List<String> keys = new ArrayList<String>(); Map<String, Long> amountDepositsP...
// Path: src/main/java/com/webpagebytes/wpbsample/data/DepositWithdrawal.java // public class DepositWithdrawal { // public enum OperationType // { // DEPOSIT, // WITHDRAWAL // }; // private long id; // private OperationType type; // private int user_id; // private long amount; // private Date dat...
List<DepositWithdrawal> operations = database.getDepositsWithdrawalsForUser(user_id, DepositWithdrawal.OperationType.DEPOSIT, past, 1, MAX_RECORDS);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ReportDWController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/DepositWithdrawal.java // public class DepositWithdrawal { // public enum OperationType // { // DEPOSIT, // WITHDRAWAL // }; // private long id; // private OperationType type; // private int user_id; // private long amount; // private Date dat...
import com.webpagebytes.wpbsample.data.DepositWithdrawal; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.DepositWithdrawal.OperationType; import com.webpagebytes.wpbsample.utility.DateUtility; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayLi...
Integer user_id = (Integer) session.getSessionMap().get(SESSION_LOGIN_USERID); int interval = getInterval(model); Date past = DateUtility.addDays(new Date(), -interval); List<Date> dates = new ArrayList<Date>(); List<String> keys = new ArrayList<String>(); Map<String, Long> amountDepositsP...
// Path: src/main/java/com/webpagebytes/wpbsample/data/DepositWithdrawal.java // public class DepositWithdrawal { // public enum OperationType // { // DEPOSIT, // WITHDRAWAL // }; // private long id; // private OperationType type; // private int user_id; // private long amount; // private Date dat...
List<DepositWithdrawal> operations = database.getDepositsWithdrawalsForUser(user_id, DepositWithdrawal.OperationType.DEPOSIT, past, 1, MAX_RECORDS);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/WPBSampleThread.java
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleFopService.java // public class SampleFopService { // // private static SampleFopService instance; // private FopFactory fopFactory; // private TransformerFactory transformerFactory; // private static volatile Object lock = new Object(); // /...
import com.webpagebytes.wpbsample.utility.SampleFopService; import com.webpagebytes.wpbsample.utility.SampleConfigurator; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.util.logging.Level; import java.util.logging.Logge...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleFopService.java // public class SampleFopService { // // private static SampleFopService instance; // private FopFactory fopFactory; // private TransformerFactory transformerFactory; // private static volatile Object lock = new Object(); // /...
String basePath = SampleConfigurator.getInstance().getConfig("storageDir");
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/WPBSampleThread.java
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleFopService.java // public class SampleFopService { // // private static SampleFopService instance; // private FopFactory fopFactory; // private TransformerFactory transformerFactory; // private static volatile Object lock = new Object(); // /...
import com.webpagebytes.wpbsample.utility.SampleFopService; import com.webpagebytes.wpbsample.utility.SampleConfigurator; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.util.logging.Level; import java.util.logging.Logge...
String user_name = configModel.getCmsModel().get(WPBModel.GLOBALS_KEY).get("TEST_USERNAME_PDF_GENERATION"); if (null == maxRunsStr || user_name == null) { return; } long t0 = System.currentTimeMillis(); String basePath = SampleConfigurator.getInstance().getConfig("storageDir"); int ...
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleFopService.java // public class SampleFopService { // // private static SampleFopService instance; // private FopFactory fopFactory; // private TransformerFactory transformerFactory; // private static volatile Object lock = new Object(); // /...
SampleFopService fopService = SampleFopService.getInstance();
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/HomeController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
import java.sql.SQLException; import java.util.Date; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.we...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/HomeController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
import java.sql.SQLException; import java.util.Date; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.we...
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Account.java // public class Account { // private int user_id; // private long balance; // // public int getUser_id() { // return user_id; // } // public void setUser_id(int user_id) { // this.user_id = user_id; // } // public long getBalance...
Account account = database.getAccount(user_id);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ChangeProfileController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.wpbsample.data.User; import com.webpagebytes.wpbsample.utility.HashService; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import java.util.UUID; import javax.servlet.http.HttpServle...
{ values.put("email", ""); } else { values.put("email", email); } if (password.length() == 0) { errors.put("password", "Error.password.empty"); } else if (password.length() > 255) { errors.put("password", "Error.password.length"); } if (!(receiveNewsletter == nu...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ChangeProfileController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.wpbsample.data.User; import com.webpagebytes.wpbsample.utility.HashService; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import java.util.UUID; import javax.servlet.http.HttpServle...
return; } Integer user_id = (Integer) session.getSessionMap().get(SESSION_LOGIN_USERID); try { User user = database.getUser(user_id); String password = request.getParameter("password"); String newEmail = request.getParameter("email"); String receiveNewsletterStr = request.getParamete...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
pswHash = HashService.getHashSha1(password.getBytes());
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ChangePasswordController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.User; import com.webpagebytes.wpbsample.utility.HashService; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import j...
if (oldPassword.length() == 0) { errors.put("oldPassword", "Error.password.empty"); } else if (oldPassword.length() > 255) { errors.put("oldPassword", "Error.password.length"); } if (password.length() == 0) { errors.put("password", "Error.password.empty"); } else if (password....
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
Session session = getSession(request, response);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ChangePasswordController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.User; import com.webpagebytes.wpbsample.utility.HashService; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import j...
} public void handleRequest(HttpServletRequest request, HttpServletResponse response, WPBModel model, WPBForward forward) throws WPBException { Session session = getSession(request, response); if (false == handleAuthentication(request, response, model, forward, session)) { return; } Integer...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
User user = database.getUser(user_id);
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/ChangePasswordController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Session; import com.webpagebytes.wpbsample.data.User; import com.webpagebytes.wpbsample.utility.HashService; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import j...
{ return; } Integer user_id = (Integer) session.getSessionMap().get(SESSION_LOGIN_USERID); String oldPassword = request.getParameter("oldPassword"); String password = request.getParameter("password"); Map<String, String> errors = new HashMap<String, String>(); performValidation(re...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
oldPswHash = HashService.getHashSha1(oldPassword.getBytes());
webpagebytes/demo-cms-app
src/main/java/com/webpagebytes/wpbsample/controllers/LoginGetController.java
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.webpagebytes.cms.WPBForward; import com.webpagebytes.cms.WPBModel; import com.webpagebytes.cms.exception.WPBException; import com.webpagebytes.wpbsample.data.Session;
/* * Copyright 2015 Webpagebytes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java // public class Session { // private String id; // private Integer user_id; // private Date create_timestamp; // private HashMap<String, Object> sessionMap; // // public String getId() { // return id; // } // public void setId(Strin...
Session session = getSession(request, response);
masl123/YM2151-Midi-Controller
src/ym2151/DataModel/OPMFile.java
// Path: src/ym2151/Utils.java // public class Utils { // // /** // * Get the extension of a file. // */ // public static String getExtension(File f) { // String ext = null; // String s = f.getName(); // int i = s.lastIndexOf('.'); // // if (i > 0 && i < s.length() - 1) { // ext...
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; import java.util.HashMap; import javax.swing.JOptionPane; import ym2151.Utils;
String name = instrHead.substring(instrHead.indexOf(' ')); var = Integer.parseInt(instrHead.substring(0, instrHead.indexOf(' '))); ins = new Instrument(name); opm.addInstrument(ins,var); }else if(!line.equals("")){ //everything else (parts of a Instrument) if(ins == null) { r....
// Path: src/ym2151/Utils.java // public class Utils { // // /** // * Get the extension of a file. // */ // public static String getExtension(File f) { // String ext = null; // String s = f.getName(); // int i = s.lastIndexOf('.'); // // if (i > 0 && i < s.length() - 1) { // ext...
if(!Utils.getExtension(path).equalsIgnoreCase("opm")){
masl123/YM2151-Midi-Controller
src/ym2151/Swing/ListSelector.java
// Path: src/ym2151/Utils.java // public class Utils { // // /** // * Get the extension of a file. // */ // public static String getExtension(File f) { // String ext = null; // String s = f.getName(); // int i = s.lastIndexOf('.'); // // if (i > 0 && i < s.length() - 1) { // ext...
import javax.swing.DefaultListModel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JList; import ym2151.Utils; import java.awt.BorderLayout; import java.util.List;
/** * YM2151 - Midi Controller Software for Arduino Shield * (C) 2016 Marcel Weiß * * This program is free software : you can redistribute it and / or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any...
// Path: src/ym2151/Utils.java // public class Utils { // // /** // * Get the extension of a file. // */ // public static String getExtension(File f) { // String ext = null; // String s = f.getName(); // int i = s.lastIndexOf('.'); // // if (i > 0 && i < s.length() - 1) { // ext...
this(Utils.getListModel(data));
masl123/YM2151-Midi-Controller
src/ym2151/Swing/OperatorPanel.java
// Path: src/ym2151/DataModel/Operator.java // public class Operator { // // /** // * A Map that holds the different Operator Values<br> // * There KEYs for the Different Knobs are:<br> // * AR, D1R,<br> // * D2R, RR,<br> // * D1L, TL <br> // * KS, MUL<br> // * DT1, DT2 // * */ // public final Listen...
import java.awt.Color; import javax.swing.JPanel; import javax.swing.JLabel; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Insets; import javax.swing.border.LineBorder; import ym2151.DataModel.Operator;
/** * YM2151 - Midi Controller Software for Arduino Shield * (C) 2016 Marcel Weiß * * This program is free software : you can redistribute it and / or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any...
// Path: src/ym2151/DataModel/Operator.java // public class Operator { // // /** // * A Map that holds the different Operator Values<br> // * There KEYs for the Different Knobs are:<br> // * AR, D1R,<br> // * D2R, RR,<br> // * D1L, TL <br> // * KS, MUL<br> // * DT1, DT2 // * */ // public final Listen...
public OperatorPanel(Operator op) {
masl123/YM2151-Midi-Controller
src/ym2151/Swing/Knob.java
// Path: src/ym2151/Utils.java // public class Utils { // // /** // * Get the extension of a file. // */ // public static String getExtension(File f) { // String ext = null; // String s = f.getName(); // int i = s.lastIndexOf('.'); // // if (i > 0 && i < s.length() - 1) { // ext...
import ym2151.Utils; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.AffineTransform; import java.util.LinkedList; import javax.swing...
/** * Removes all Listeners from this Knob * */ public void removeAllKnobListener(){ listeners = new LinkedList<KnobListener>(); } /** * Sends a Event to all the Listeners * */ private void dispatchEvent(){ for(KnobListener l : listeners){ l.knobTurned(var); } } @Override public void pain...
// Path: src/ym2151/Utils.java // public class Utils { // // /** // * Get the extension of a file. // */ // public static String getExtension(File f) { // String ext = null; // String s = f.getName(); // int i = s.lastIndexOf('.'); // // if (i > 0 && i < s.length() - 1) { // ext...
Utils.fillCenteredCircle(g2d,middle,getHeight()/2,middle*2);
masl123/YM2151-Midi-Controller
src/ym2151/Swing/LFOPanel.java
// Path: src/ym2151/DataModel/LFO.java // public class LFO { // // // /** // * A Map that holds the different Controller Values<br> // * There KEYs for the Different Knobs are:<br> // * LFRQ,<br> // * AMD,<br> // * PMD,<br> // * WF,<br> // * NFRQ,<br> // * NE <br> // * */ // public final Listene...
import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JToggleButton; import javax.swing.border.LineBorder; import java.awt.Color; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Insets; import ...
NamedKnob knobAmD = new NamedKnob(lfo.map, "AMD"); GridBagConstraints gbc_knobAP = new GridBagConstraints(); gbc_knobAP.insets = new Insets(0, 0, 5, 5); gbc_knobAP.fill = GridBagConstraints.BOTH; gbc_knobAP.gridx = 0; gbc_knobAP.gridy = 4; add(knobAmD, gbc_knobAP); final JToggleButton tglbtnEnableNoi...
// Path: src/ym2151/DataModel/LFO.java // public class LFO { // // // /** // * A Map that holds the different Controller Values<br> // * There KEYs for the Different Knobs are:<br> // * LFRQ,<br> // * AMD,<br> // * PMD,<br> // * WF,<br> // * NFRQ,<br> // * NE <br> // * */ // public final Listene...
private class ToggleButtonListener implements ActionListener, HashMapListener<String, Integer>{
masl123/YM2151-Midi-Controller
src/ym2151/Swing/CommonPanel.java
// Path: src/ym2151/DataModel/Common.java // public class Common { // // /** // * A Map that holds the different Controller Values<br> // * There KEYs for the Different Knobs are: // * <br><br> PAN, FL, CON, AMS, PMS, // * <br>OP1_EN, OP2_EN, OP3_EN, OP4_EN, // * <br>AMSEN_OP1, AMSEN_OP2, AMSEN_OP3, AMSE...
import ym2151.DataModel.Common; import ym2151.Swing.ListenerHashMap.HashMapListener; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.BoxLayout; import java.awt.Component; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swi...
/** * YM2151 - Midi Controller Software for Arduino Shield * (C) 2016 Marcel Weiß * * This program is free software : you can redistribute it and / or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any...
// Path: src/ym2151/DataModel/Common.java // public class Common { // // /** // * A Map that holds the different Controller Values<br> // * There KEYs for the Different Knobs are: // * <br><br> PAN, FL, CON, AMS, PMS, // * <br>OP1_EN, OP2_EN, OP3_EN, OP4_EN, // * <br>AMSEN_OP1, AMSEN_OP2, AMSEN_OP3, AMSE...
public CommonPanel(final Common common) {
masl123/YM2151-Midi-Controller
src/ym2151/Swing/CommonPanel.java
// Path: src/ym2151/DataModel/Common.java // public class Common { // // /** // * A Map that holds the different Controller Values<br> // * There KEYs for the Different Knobs are: // * <br><br> PAN, FL, CON, AMS, PMS, // * <br>OP1_EN, OP2_EN, OP3_EN, OP4_EN, // * <br>AMSEN_OP1, AMSEN_OP2, AMSEN_OP3, AMSE...
import ym2151.DataModel.Common; import ym2151.Swing.ListenerHashMap.HashMapListener; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.BoxLayout; import java.awt.Component; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swi...
//Button to increase the Selected Algorithm JButton buttonRight = new JButton(""); buttonRight.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { int algorithm = algorithmSelector.getAlgorithm(); algorithm = (algorithm+1) % 8; algorithmSelector.setAlgor...
// Path: src/ym2151/DataModel/Common.java // public class Common { // // /** // * A Map that holds the different Controller Values<br> // * There KEYs for the Different Knobs are: // * <br><br> PAN, FL, CON, AMS, PMS, // * <br>OP1_EN, OP2_EN, OP3_EN, OP4_EN, // * <br>AMSEN_OP1, AMSEN_OP2, AMSEN_OP3, AMSE...
private class AlgorithmSelectorListener implements HashMapListener<String, Integer>{
googleworkspace/java-samples
vault/vault-hold-migration-api/src/main/java/com/google/vault/chatmigration/QuickStart.java
// Path: vault/vault-hold-migration-api/src/main/java/com/google/vault/chatmigration/MigrationHelper.java // enum MigrationOptions { // GENERATE_REPORT("a", "genholdreport", "Generate Hold Report"), // DUPLICATE_HOLDS("b", "duplicateholds", "Duplicate Gmail Holds to Hangouts Chat"), // REPORT_FILE("f", "reportfil...
import com.google.api.services.admin.directory.Directory; import com.google.api.services.vault.v1.Vault; import com.google.vault.chatmigration.MigrationHelper.MigrationOptions; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.nio.charset.Charset; import java.util.logging.Level; im...
package com.google.vault.chatmigration; public class QuickStart { private static final Logger LOGGER = Logger.getLogger(QuickStart.class.getName()); private static boolean hasHelpOption(String... args) throws ParseException { boolean hasHelp = false; Options helpOptions = new Options().addOption(Migrat...
// Path: vault/vault-hold-migration-api/src/main/java/com/google/vault/chatmigration/MigrationHelper.java // enum MigrationOptions { // GENERATE_REPORT("a", "genholdreport", "Generate Hold Report"), // DUPLICATE_HOLDS("b", "duplicateholds", "Duplicate Gmail Holds to Hangouts Chat"), // REPORT_FILE("f", "reportfil...
if (cl.hasOption(MigrationOptions.HELP.getOption())) {
wizzardo/epoll
src/main/java/com/wizzardo/epoll/ByteBufferWrapper.java
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableData.java // public abstract class ReadableData implements Closeable { // // public ByteBufferWrapper getByteBuffer(ByteBufferProvider bufferProvider) { // return bufferProvider.getBuffer(); // } // // public void close() throws IOExceptio...
import com.wizzardo.epoll.readable.ReadableData; import java.nio.ByteBuffer;
package com.wizzardo.epoll; /** * @author: wizzardo * Date: 3/15/14 */ public class ByteBufferWrapper { private final ByteBuffer buffer; private int offset = 0; public final long address; public ByteBufferWrapper(ByteBuffer buffer) { if (!buffer.isDirect()) throw new Illegal...
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableData.java // public abstract class ReadableData implements Closeable { // // public ByteBufferWrapper getByteBuffer(ByteBufferProvider bufferProvider) { // return bufferProvider.getBuffer(); // } // // public void close() throws IOExceptio...
public ByteBufferWrapper(ReadableData data) {
wizzardo/epoll
src/main/java/com/wizzardo/epoll/EpollCore.java
// Path: src/main/java/com/wizzardo/epoll/Utils.java // public static int readInt(byte[] b, int offset) { // // if (b.length - offset < 4 || offset < 0) // // throw new IndexOutOfBoundsException("byte[].length = " + b.length + ", but offset = " + offset + " and we need 4 bytes"); // // re...
import com.wizzardo.tools.misc.Unchecked; import com.wizzardo.tools.reflection.FieldReflection; import com.wizzardo.tools.reflection.FieldReflectionFactory; import com.wizzardo.tools.reflection.UnsafeTools; import java.io.IOException; import java.net.InetAddress; import java.nio.Buffer; import java.nio.ByteBuffer; impo...
ioThreads[i].start(); } ByteBuffer eventsBuffer = this.events; byte[] events = new byte[eventsBuffer.capacity()]; byte[] newConnections = new byte[eventsBuffer.capacity()]; if (ioThreadsCount == 0) { IOThread<? extends T> ioThread = createIOThread(1, 1);...
// Path: src/main/java/com/wizzardo/epoll/Utils.java // public static int readInt(byte[] b, int offset) { // // if (b.length - offset < 4 || offset < 0) // // throw new IndexOutOfBoundsException("byte[].length = " + b.length + ", but offset = " + offset + " and we need 4 bytes"); // // re...
int fd = readInt(events, i + 1);
wizzardo/epoll
src/main/java/com/wizzardo/epoll/EpollCore.java
// Path: src/main/java/com/wizzardo/epoll/Utils.java // public static int readInt(byte[] b, int offset) { // // if (b.length - offset < 4 || offset < 0) // // throw new IndexOutOfBoundsException("byte[].length = " + b.length + ", but offset = " + offset + " and we need 4 bytes"); // // re...
import com.wizzardo.tools.misc.Unchecked; import com.wizzardo.tools.reflection.FieldReflection; import com.wizzardo.tools.reflection.FieldReflectionFactory; import com.wizzardo.tools.reflection.UnsafeTools; import java.io.IOException; import java.net.InetAddress; import java.nio.Buffer; import java.nio.ByteBuffer; impo...
public void setTTL(long milliseconds) { ttl = milliseconds; } public long getTTL() { return ttl; } public void close() { synchronized (this) { if (running) { running = false; stopListening(scope); try { ...
// Path: src/main/java/com/wizzardo/epoll/Utils.java // public static int readInt(byte[] b, int offset) { // // if (b.length - offset < 4 || offset < 0) // // throw new IndexOutOfBoundsException("byte[].length = " + b.length + ", but offset = " + offset + " and we need 4 bytes"); // // re...
putConnection(createConnection(readInt(buffer, j), readInt(buffer, j + 4), readShort(buffer, j + 8)));
wizzardo/epoll
src/main/java/com/wizzardo/epoll/IOThread.java
// Path: src/main/java/com/wizzardo/epoll/Utils.java // public static int readInt(byte[] b, int offset) { // // if (b.length - offset < 4 || offset < 0) // // throw new IndexOutOfBoundsException("byte[].length = " + b.length + ", but offset = " + offset + " and we need 4 bytes"); // // re...
import java.io.IOException; import java.lang.reflect.Array; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import static com.wizzardo.epoll.Utils.readInt;
package com.wizzardo.epoll; /** * @author: wizzardo * Date: 6/25/14 */ public class IOThread<T extends Connection> extends EpollCore<T> { protected final int number; protected final int divider; protected T[] connections = (T[]) new Connection[1000]; protected Map<Integer, T> newConnections = new ...
// Path: src/main/java/com/wizzardo/epoll/Utils.java // public static int readInt(byte[] b, int offset) { // // if (b.length - offset < 4 || offset < 0) // // throw new IndexOutOfBoundsException("byte[].length = " + b.length + ", but offset = " + offset + " and we need 4 bytes"); // // re...
int fd = readInt(events, i + 1);
wizzardo/epoll
src/main/java/com/wizzardo/epoll/readable/ReadableBuilder.java
// Path: src/main/java/com/wizzardo/epoll/ByteBufferProvider.java // public interface ByteBufferProvider { // ByteBufferWrapper getBuffer(); // // /** // * @return result of casting Thread.currentThread() to {@link ByteBufferProvider} // * @throws ClassCastException if current thread doesn't implemen...
import com.wizzardo.epoll.ByteBufferProvider; import com.wizzardo.epoll.ByteBufferWrapper; import java.io.IOException; import java.nio.ByteBuffer;
return append(bytes, 0, bytes.length); } public ReadableBuilder append(byte[] bytes, int offset, int length) { if (partsCount + 1 >= parts.length) increaseSize(); parts[partsCount] = new ReadableByteArray(bytes, offset, length); partsCount++; return this; ...
// Path: src/main/java/com/wizzardo/epoll/ByteBufferProvider.java // public interface ByteBufferProvider { // ByteBufferWrapper getBuffer(); // // /** // * @return result of casting Thread.currentThread() to {@link ByteBufferProvider} // * @throws ClassCastException if current thread doesn't implemen...
public ByteBufferWrapper getByteBuffer(ByteBufferProvider bufferProvider) {
wizzardo/epoll
src/main/java/com/wizzardo/epoll/readable/ReadableBuilder.java
// Path: src/main/java/com/wizzardo/epoll/ByteBufferProvider.java // public interface ByteBufferProvider { // ByteBufferWrapper getBuffer(); // // /** // * @return result of casting Thread.currentThread() to {@link ByteBufferProvider} // * @throws ClassCastException if current thread doesn't implemen...
import com.wizzardo.epoll.ByteBufferProvider; import com.wizzardo.epoll.ByteBufferWrapper; import java.io.IOException; import java.nio.ByteBuffer;
return append(bytes, 0, bytes.length); } public ReadableBuilder append(byte[] bytes, int offset, int length) { if (partsCount + 1 >= parts.length) increaseSize(); parts[partsCount] = new ReadableByteArray(bytes, offset, length); partsCount++; return this; ...
// Path: src/main/java/com/wizzardo/epoll/ByteBufferProvider.java // public interface ByteBufferProvider { // ByteBufferWrapper getBuffer(); // // /** // * @return result of casting Thread.currentThread() to {@link ByteBufferProvider} // * @throws ClassCastException if current thread doesn't implemen...
public ByteBufferWrapper getByteBuffer(ByteBufferProvider bufferProvider) {
wizzardo/epoll
src/main/java/com/wizzardo/epoll/Connection.java
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableByteArray.java // public class ReadableByteArray extends ReadableData { // protected byte[] bytes; // protected int offset, length, position; // // public ReadableByteArray(byte[] bytes) { // this(bytes, 0, bytes.length); // } // // ...
import com.wizzardo.epoll.readable.ReadableByteArray; import com.wizzardo.epoll.readable.ReadableData; import com.wizzardo.tools.io.IOTools; import java.io.*; import java.nio.ByteBuffer; import java.util.Deque; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.atomic...
package com.wizzardo.epoll; /** * @author: wizzardo * Date: 1/6/14 */ public class Connection implements Cloneable, Closeable { protected static final int EPOLLIN = 0x001; protected static final int EPOLLOUT = 0x004; protected int fd; protected int ip, port;
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableByteArray.java // public class ReadableByteArray extends ReadableData { // protected byte[] bytes; // protected int offset, length, position; // // public ReadableByteArray(byte[] bytes) { // this(bytes, 0, bytes.length); // } // // ...
protected volatile Deque<ReadableData> sending;
wizzardo/epoll
src/main/java/com/wizzardo/epoll/Connection.java
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableByteArray.java // public class ReadableByteArray extends ReadableData { // protected byte[] bytes; // protected int offset, length, position; // // public ReadableByteArray(byte[] bytes) { // this(bytes, 0, bytes.length); // } // // ...
import com.wizzardo.epoll.readable.ReadableByteArray; import com.wizzardo.epoll.readable.ReadableData; import com.wizzardo.tools.io.IOTools; import java.io.*; import java.nio.ByteBuffer; import java.util.Deque; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.atomic...
long last = this.lastEvent; this.lastEvent = lastEvent; return last; } long getLastEvent() { return lastEvent; } public boolean isAlive() { return alive; } protected synchronized void setIsAlive(boolean isAlive) { alive = isAlive; } pub...
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableByteArray.java // public class ReadableByteArray extends ReadableData { // protected byte[] bytes; // protected int offset, length, position; // // public ReadableByteArray(byte[] bytes) { // this(bytes, 0, bytes.length); // } // // ...
return write(new ReadableByteArray(bytes, offset, length), bufferProvider);
wizzardo/epoll
src/test/java/com/wizzardo/epoll/SslServerTest.java
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableData.java // public abstract class ReadableData implements Closeable { // // public ByteBufferWrapper getByteBuffer(ByteBufferProvider bufferProvider) { // return bufferProvider.getBuffer(); // } // // public void close() throws IOExceptio...
import com.wizzardo.epoll.readable.ReadableData; import com.wizzardo.tools.http.*; import com.wizzardo.tools.security.MD5; import org.junit.Assert; import org.junit.Test; import javax.net.ssl.*; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; imp...
if (read >= image.length / 10) { Thread.sleep(2000); read = 0; } } Assert.assertEquals(MD5.create().update(image).asString(), MD5.create().update(out.toByteArray()).asString()); // Thread.sleep(25 * 60 * 1000); server.close(); }...
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableData.java // public abstract class ReadableData implements Closeable { // // public ByteBufferWrapper getByteBuffer(ByteBufferProvider bufferProvider) { // return bufferProvider.getBuffer(); // } // // public void close() throws IOExceptio...
connection.write(new ReadableData() {
wizzardo/epoll
src/test/java/com/wizzardo/epoll/EpollClientTest.java
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableByteArray.java // public class ReadableByteArray extends ReadableData { // protected byte[] bytes; // protected int offset, length, position; // // public ReadableByteArray(byte[] bytes) { // this(bytes, 0, bytes.length); // } // // ...
import com.wizzardo.epoll.readable.ReadableByteArray; import com.wizzardo.tools.misc.Unchecked; import java.io.IOException; import java.net.UnknownHostException; import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicInteger;
package com.wizzardo.epoll; /** * @author: wizzardo * Date: 5/5/14 */ public class EpollClientTest { // @Test public void simpleTest() throws UnknownHostException { final EpollCore epoll = new EpollCore<Connection>() { @Override protected IOThread createIOThread(int num...
// Path: src/main/java/com/wizzardo/epoll/readable/ReadableByteArray.java // public class ReadableByteArray extends ReadableData { // protected byte[] bytes; // protected int offset, length, position; // // public ReadableByteArray(byte[] bytes) { // this(bytes, 0, bytes.length); // } // // ...
connection.write(new ReadableByteArray(("GET /1 HTTP/1.1\r\n" +
ArcBees/gwtquery
samples/src/main/java/gwtquery/samples/client/effects/SlideEffectsSample.java
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java // public static final Class<Effects> Effects = GQuery.registerPlugin( // Effects.class, new Plugin<Effects>() { // public Effects init(GQuery gq) { // return new Effects(gq); // } // }); // // Path: gwtqu...
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.dom.client.Element; import com.google.gwt.query.client.Function; import static com.google.gwt.query.client.plugins.Effects.Effects; import static com.google.gwt.query.client.GQuery.$;
/* * Copyright 2011, The gwtquery team. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java // public static final Class<Effects> Effects = GQuery.registerPlugin( // Effects.class, new Plugin<Effects>() { // public Effects init(GQuery gq) { // return new Effects(gq); // } // }); // // Path: gwtqu...
$("#slideUp > button").click(new Function() {
ArcBees/gwtquery
samples/src/main/java/gwtquery/samples/client/effects/SlideEffectsSample.java
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java // public static final Class<Effects> Effects = GQuery.registerPlugin( // Effects.class, new Plugin<Effects>() { // public Effects init(GQuery gq) { // return new Effects(gq); // } // }); // // Path: gwtqu...
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.dom.client.Element; import com.google.gwt.query.client.Function; import static com.google.gwt.query.client.plugins.Effects.Effects; import static com.google.gwt.query.client.GQuery.$;
/* * Copyright 2011, The gwtquery team. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java // public static final Class<Effects> Effects = GQuery.registerPlugin( // Effects.class, new Plugin<Effects>() { // public Effects init(GQuery gq) { // return new Effects(gq); // } // }); // // Path: gwtqu...
$("#slideUp div.foo").as(Effects).slideUp();
ArcBees/gwtquery
gwtquery-core/src/main/java/com/google/gwt/query/vm/JsonFactoryJre.java
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilder.java // public interface JsonBuilder extends IsProperties { // // /** // * parses a json string and loads the resulting properties object, // * if the param 'fix' is true, the syntax of the json string will be // * checked...
import com.google.gwt.query.client.Function; import com.google.gwt.query.client.IsProperties; import com.google.gwt.query.client.builders.JsonBuilder; import com.google.gwt.query.client.builders.JsonFactory; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; import elemental.json.JsonObject; im...
/* * Copyright 2014, The gwtquery team. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilder.java // public interface JsonBuilder extends IsProperties { // // /** // * parses a json string and loads the resulting properties object, // * if the param 'fix' is true, the syntax of the json string will be // * checked...
public <T extends JsonBuilder> T create(Class<T> clz) {
ArcBees/gwtquery
gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNativeMinIE8.java
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java // public static final Console console = GWT.isClient() ? GWT.<Console>create(Console.class) : null;
import static com.google.gwt.query.client.GQuery.console; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Node; import com.google.gwt.dom.client.NodeList;
/* * Copyright 2011, The gwtquery team. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java // public static final Console console = GWT.isClient() ? GWT.<Console>create(Console.class) : null; // Path: gwtquery-core/src/main/java/com/google/gwt/query/client/impl/SelectorEngineNativeMinIE8.java import static com.google.gwt.query.cli...
console.error("GwtQuery: Selector '" + selector
ArcBees/gwtquery
gwtquery-core/src/test/java/com/google/gwt/query/client/dbinding/DataBindingTestJre.java
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilder.java // public interface JsonBuilder extends IsProperties { // // /** // * parses a json string and loads the resulting properties object, // * if the param 'fix' is true, the syntax of the json string will be // * checked...
import com.google.gwt.core.shared.GWT; import com.google.gwt.junit.DoNotRunWith; import com.google.gwt.junit.Platform; import com.google.gwt.junit.client.GWTTestCase; import com.google.gwt.query.client.Function; import com.google.gwt.query.client.GQ; import com.google.gwt.query.client.IsProperties; import com.google.gw...
/* * Copyright 2013, The gwtquery team. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilder.java // public interface JsonBuilder extends IsProperties { // // /** // * parses a json string and loads the resulting properties object, // * if the param 'fix' is true, the syntax of the json string will be // * checked...
public interface Item extends JsonBuilder {
Russian-AI-Cup/notreal2d
src/main/java/com/codegame/codeseries/notreal2d/Body.java
// Path: src/main/java/com/codegame/codeseries/notreal2d/form/Form.java // public abstract class Form { // @Nonnull // private final Shape shape; // // protected Form(@Nonnull Shape shape) { // Preconditions.checkNotNull(shape, "Argument 'shape' is null."); // // this.shape = shape;...
import com.codeforces.commons.geometry.Point2D; import com.codeforces.commons.geometry.Vector2D; import com.codeforces.commons.text.StringUtil; import com.codegame.codeseries.notreal2d.form.Form; import com.codegame.codeseries.notreal2d.provider.ConstantMovementFrictionProvider; import com.codegame.codeseries.notr...
package com.codegame.codeseries.notreal2d; /** * @author Maxim Shipko (sladethe@gmail.com) * Date: 02.06.2015 */ public class Body { private static final AtomicLong idGenerator = new AtomicLong(); /** * Unique ID. */ private final long id = idGenerator.incrementAndGe...
// Path: src/main/java/com/codegame/codeseries/notreal2d/form/Form.java // public abstract class Form { // @Nonnull // private final Shape shape; // // protected Form(@Nonnull Shape shape) { // Preconditions.checkNotNull(shape, "Argument 'shape' is null."); // // this.shape = shape;...
private Form form;
Russian-AI-Cup/notreal2d
src/main/java/com/codegame/codeseries/notreal2d/Body.java
// Path: src/main/java/com/codegame/codeseries/notreal2d/form/Form.java // public abstract class Form { // @Nonnull // private final Shape shape; // // protected Form(@Nonnull Shape shape) { // Preconditions.checkNotNull(shape, "Argument 'shape' is null."); // // this.shape = shape;...
import com.codeforces.commons.geometry.Point2D; import com.codeforces.commons.geometry.Vector2D; import com.codeforces.commons.text.StringUtil; import com.codegame.codeseries.notreal2d.form.Form; import com.codegame.codeseries.notreal2d.provider.ConstantMovementFrictionProvider; import com.codegame.codeseries.notr...
package com.codegame.codeseries.notreal2d; /** * @author Maxim Shipko (sladethe@gmail.com) * Date: 02.06.2015 */ public class Body { private static final AtomicLong idGenerator = new AtomicLong(); /** * Unique ID. */ private final long id = idGenerator.incrementAndGe...
// Path: src/main/java/com/codegame/codeseries/notreal2d/form/Form.java // public abstract class Form { // @Nonnull // private final Shape shape; // // protected Form(@Nonnull Shape shape) { // Preconditions.checkNotNull(shape, "Argument 'shape' is null."); // // this.shape = shape;...
private MovementFrictionProvider movementFrictionProvider = new ConstantMovementFrictionProvider(0.0D);
Russian-AI-Cup/notreal2d
src/main/java/com/codegame/codeseries/notreal2d/Body.java
// Path: src/main/java/com/codegame/codeseries/notreal2d/form/Form.java // public abstract class Form { // @Nonnull // private final Shape shape; // // protected Form(@Nonnull Shape shape) { // Preconditions.checkNotNull(shape, "Argument 'shape' is null."); // // this.shape = shape;...
import com.codeforces.commons.geometry.Point2D; import com.codeforces.commons.geometry.Vector2D; import com.codeforces.commons.text.StringUtil; import com.codegame.codeseries.notreal2d.form.Form; import com.codegame.codeseries.notreal2d.provider.ConstantMovementFrictionProvider; import com.codegame.codeseries.notr...
package com.codegame.codeseries.notreal2d; /** * @author Maxim Shipko (sladethe@gmail.com) * Date: 02.06.2015 */ public class Body { private static final AtomicLong idGenerator = new AtomicLong(); /** * Unique ID. */ private final long id = idGenerator.incrementAndGe...
// Path: src/main/java/com/codegame/codeseries/notreal2d/form/Form.java // public abstract class Form { // @Nonnull // private final Shape shape; // // protected Form(@Nonnull Shape shape) { // Preconditions.checkNotNull(shape, "Argument 'shape' is null."); // // this.shape = shape;...
private MovementFrictionProvider movementFrictionProvider = new ConstantMovementFrictionProvider(0.0D);
Russian-AI-Cup/notreal2d
src/main/java/com/codegame/codeseries/notreal2d/StaticState.java
// Path: src/main/java/com/codegame/codeseries/notreal2d/listener/PositionListener.java // public interface PositionListener { // /** // * Physics engine iterates over all registered position listeners in some order and invokes this method before // * changing position. If any listener returns {@code f...
import com.codeforces.commons.geometry.Point2D; import com.codeforces.commons.geometry.Vector2D; import com.codeforces.commons.text.StringUtil; import com.codegame.codeseries.notreal2d.listener.PositionListener; import javax.annotation.Nonnull; import java.util.*; import static com.codeforces.commons.math.Math.DO...
} } this.position = this.new ListeningPoint2D(newPosition); if (positionListenerEntries != null) { for (PositionListenerEntry positionListenerEntry : positionListenerEntries) { positionListenerEntry.listener.afterChangePosition(oldPosition.copy(),...
// Path: src/main/java/com/codegame/codeseries/notreal2d/listener/PositionListener.java // public interface PositionListener { // /** // * Physics engine iterates over all registered position listeners in some order and invokes this method before // * changing position. If any listener returns {@code f...
public void registerPositionListener(@Nonnull PositionListener listener, @Nonnull String name, double priority) {
Russian-AI-Cup/notreal2d
src/main/java/com/codegame/codeseries/notreal2d/form/ArcForm.java
// Path: src/main/java/com/codegame/codeseries/notreal2d/util/GeometryUtil.java // public final class GeometryUtil { // private GeometryUtil() { // throw new UnsupportedOperationException(); // } // // @Contract(pure = true) // public static double normalizeAngle(double angle) { // ...
import com.codeforces.commons.geometry.Point2D; import com.codeforces.commons.text.StringUtil; import com.codegame.codeseries.notreal2d.util.GeometryUtil; import javax.annotation.Nonnull; import static com.codeforces.commons.math.Math.DOUBLE_PI;
package com.codegame.codeseries.notreal2d.form; /** * @author Maxim Shipko (sladethe@gmail.com) * Date: 26.06.2015 */ public class ArcForm extends ThinForm { private final double radius; private final double angle; private final double sector; public ArcForm(double radius, ...
// Path: src/main/java/com/codegame/codeseries/notreal2d/util/GeometryUtil.java // public final class GeometryUtil { // private GeometryUtil() { // throw new UnsupportedOperationException(); // } // // @Contract(pure = true) // public static double normalizeAngle(double angle) { // ...
this.angle = GeometryUtil.normalizeAngle(angle);
Russian-AI-Cup/notreal2d
src/test/java/com/codegame/codeseries/notreal2d/WorldTest.java
// Path: src/main/java/com/codegame/codeseries/notreal2d/form/CircularForm.java // public class CircularForm extends Form { // private final double radius; // private final double angularMassFactor; // // public CircularForm(double radius) { // super(Shape.CIRCLE); // // if (Double....
import com.codegame.codeseries.notreal2d.form.CircularForm; import org.junit.Assert; import org.junit.Test; import static com.codeforces.commons.math.Math.max; import static com.codeforces.commons.math.Math.pow;
package com.codegame.codeseries.notreal2d; /** * @author Maxim Shipko (sladethe@gmail.com) * Date: 08.06.2015 */ @SuppressWarnings("OverlyLongMethod") public class WorldTest { @Test public void testMovement() throws Exception { int iterationCountPerStep = Defaults.ITERATION_COU...
// Path: src/main/java/com/codegame/codeseries/notreal2d/form/CircularForm.java // public class CircularForm extends Form { // private final double radius; // private final double angularMassFactor; // // public CircularForm(double radius) { // super(Shape.CIRCLE); // // if (Double....
body.setForm(new CircularForm(1.0D));
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/reader/JDom2ReaderBuilder.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import javax.xml.stream.XMLStreamReader; import org.jdom2.Element; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxml.reader....
package com.giffing.easyxml.jdom2.reader; public class JDom2ReaderBuilder<R> { private JDom2Reader<R> reader;
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
private Parser<Element, R> parser;
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/reader/JDom2ReaderBuilder.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import javax.xml.stream.XMLStreamReader; import org.jdom2.Element; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxml.reader....
package com.giffing.easyxml.jdom2.reader; public class JDom2ReaderBuilder<R> { private JDom2Reader<R> reader; private Parser<Element, R> parser; private List<JDom2Reader<R>> readers = new ArrayList<>();
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
private List<ItemReader<XMLStreamReader, Void>> staxItemReaders = new ArrayList<>();
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/writer/Jdom2ItemWriterBuilder.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.util.function.Consumer; import java.util.function.Function; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxml.jdom2.writer.context.Jdom2WriterContext;
package com.giffing.easyxml.jdom2.writer; public class Jdom2ItemWriterBuilder<T extends ParseContext> { protected Function<T, Boolean> shouldHandle; protected boolean shouldRemove;
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
protected Consumer<Jdom2WriterContext> consumer;
MarcGiffing/easyxml
easyxml-jaxb/src/main/java/com/giffing/easyxml/jaxb/JaxbReader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import javax.xml.stream.XMLStreamReader; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerExcepti...
package com.giffing.easyxml.jaxb; public class JaxbReader<R> implements Reader<JAXBElement<R>, R> { private List<ItemReader<JAXBElement<R>, R>> readers = new ArrayList<>(); private Unmarshaller jaxbUnmarshaller; public JaxbReader(List<ItemReader<JAXBElement<R>, R>> readers, String jaxbContextPath) { this.re...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
public TransformResult<JAXBElement<R>> transform(TransformContext<JAXBElement<R>, R> context) {
MarcGiffing/easyxml
easyxml-jaxb/src/main/java/com/giffing/easyxml/jaxb/JaxbReader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import javax.xml.stream.XMLStreamReader; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerExcepti...
package com.giffing.easyxml.jaxb; public class JaxbReader<R> implements Reader<JAXBElement<R>, R> { private List<ItemReader<JAXBElement<R>, R>> readers = new ArrayList<>(); private Unmarshaller jaxbUnmarshaller; public JaxbReader(List<ItemReader<JAXBElement<R>, R>> readers, String jaxbContextPath) { this.re...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
public TransformResult<JAXBElement<R>> transform(TransformContext<JAXBElement<R>, R> context) {
MarcGiffing/easyxml
easyxml-jaxb/src/main/java/com/giffing/easyxml/jaxb/JaxbReader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import javax.xml.stream.XMLStreamReader; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerExcepti...
public JaxbReader(List<ItemReader<JAXBElement<R>, R>> readers, String jaxbContextPath) { this.readers = readers; try { jaxbUnmarshaller = JAXBContext.newInstance(jaxbContextPath).createUnmarshaller(); } catch (JAXBException e) { throw new IllegalStateException(e); } } @Override public List<ItemReade...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
return new JaxbTransformerResult<R>(jaxbElement);
MarcGiffing/easyxml
easyxml-jaxb/src/main/java/com/giffing/easyxml/jaxb/JaxbItemReaderBuilder.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.util.function.Function; import javax.xml.bind.JAXBElement; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxml.reader.item.ItemReaderBuilder;
package com.giffing.easyxml.jaxb; public class JaxbItemReaderBuilder<R> extends ItemReaderBuilder<JAXBElement<R>, R> { private Class<?> jaxbClass; public JaxbItemReaderBuilder() { super.handle((e) -> e.getValue()); } @Override public JaxbItemReaderBuilder<R> shouldHandle(
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
Function<ParseContext, Boolean> shouldHandle) {
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/writer/Jdom2ItemWriter.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxml.jdom2.writer.context.Jdom2WriterContext;
package com.giffing.easyxml.jdom2.writer; public interface Jdom2ItemWriter<T extends ParseContext> { boolean shouldHandle(T parseContext);
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
void handle(Jdom2WriterContext context);
MarcGiffing/easyxml
easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/reader/item/ItemReader.java // public interface ItemReader<T, R> { // // /** // * @param t transform result // */ // R read(T t); // // /** // * Indicates if the reader is responsible for the current context // * // * @param context // */ // boo...
import javax.xml.stream.XMLStreamReader; import com.giffing.easyxml.reader.item.ItemReader;
package com.giffing.easyxml.context; public class TransformContext<T, R> { private XMLStreamReader streamReader;
// Path: easyxml-core/src/main/java/com/giffing/easyxml/reader/item/ItemReader.java // public interface ItemReader<T, R> { // // /** // * @param t transform result // */ // R read(T t); // // /** // * Indicates if the reader is responsible for the current context // * // * @param context // */ // boo...
private ItemReader<T, R> itemReader;
MarcGiffing/easyxml
easyxml-core/src/main/java/com/giffing/easyxml/reader/Parser.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.apache.commons.lang3.StringUtils; import com.giff...
package com.giffing.easyxml.reader; public class Parser<T, R> implements Iterable<R> { private XMLInputFactory xif = XMLInputFactory.newInstance(); private XMLStreamReader streamReader = null; private InputStream inputStream = null; private List<String> currentElementPath = new ArrayList<>(); private List...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
private ParseContext context;
MarcGiffing/easyxml
easyxml-core/src/main/java/com/giffing/easyxml/reader/Parser.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.apache.commons.lang3.StringUtils; import com.giff...
package com.giffing.easyxml.reader; public class Parser<T, R> implements Iterable<R> { private XMLInputFactory xif = XMLInputFactory.newInstance(); private XMLStreamReader streamReader = null; private InputStream inputStream = null; private List<String> currentElementPath = new ArrayList<>(); private List...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
private ItemReader<T, R> currentItemReader = null;
MarcGiffing/easyxml
easyxml-core/src/main/java/com/giffing/easyxml/reader/Parser.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.apache.commons.lang3.StringUtils; import com.giff...
package com.giffing.easyxml.reader; public class Parser<T, R> implements Iterable<R> { private XMLInputFactory xif = XMLInputFactory.newInstance(); private XMLStreamReader streamReader = null; private InputStream inputStream = null; private List<String> currentElementPath = new ArrayList<>(); private List...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
new TransformContext<T, R>(streamReader, currentItemReader))
MarcGiffing/easyxml
easyxml-core/src/main/java/com/giffing/easyxml/reader/Parser.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.apache.commons.lang3.StringUtils; import com.giff...
this.readers = readers; this.staxItemReaders = staxItemReaders; this.context = context; } public void setParseContext(ParseContext context) { this.context = context; } public R readNext() { return currentItemReader.read(currentReader.transform( new TransformContext<T, R>(streamReader, currentItemRead...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
staxItemReader.read(new StaxTransformerResult(streamReader).getContent());
MarcGiffing/easyxml
easyxml-jaxb/src/main/java/com/giffing/easyxml/jaxb/JaxbReaderBuilder.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.stream.XMLStreamReader; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxm...
package com.giffing.easyxml.jaxb; public class JaxbReaderBuilder<R> { private JaxbReader<R> reader;
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
private Parser<JAXBElement<R>, R> parser;
MarcGiffing/easyxml
easyxml-jaxb/src/main/java/com/giffing/easyxml/jaxb/JaxbReaderBuilder.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.stream.XMLStreamReader; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxm...
package com.giffing.easyxml.jaxb; public class JaxbReaderBuilder<R> { private JaxbReader<R> reader; private Parser<JAXBElement<R>, R> parser; private List<JaxbReader<R>> readers = new ArrayList<>();
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
private List<ItemReader<XMLStreamReader, Void>> staxItemReaders = new ArrayList<>();
MarcGiffing/easyxml
easyxml-jdom2-example/src/main/java/com/giffing/easyxml/jdom2/example/NoteItemReader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import org.jdom2.Element; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxml.jdom2.example.domain.Note; import com.giffing.easyxml.reader.item.ItemReader;
package com.giffing.easyxml.jdom2.example; public class NoteItemReader implements ItemReader<Element, Note> { private NoteContext context; @Override public Note read(Element element) { Note note = new Note(); note.setId(Long.valueOf(element.getChildTextTrim("id"))); note.setContent(element.getChildTextTr...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
public boolean shouldHandle(ParseContext context) {
MarcGiffing/easyxml
easyxml-jdom2-example/src/main/java/com/giffing/easyxml/jdom2/example/GroupItemReader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import javax.xml.stream.XMLStreamReader; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxml.reader.item.ItemReader;
package com.giffing.easyxml.jdom2.example; public class GroupItemReader implements ItemReader<XMLStreamReader, Void> { private NoteContext context; @Override
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
public boolean shouldHandle(ParseContext context) {
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/reader/JDom2Reader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
import java.util.ArrayList; import java.util.List; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stax.StAXSource; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.transform.JDOMResul...
package com.giffing.easyxml.jdom2.reader; public class JDom2Reader<R> implements Reader<Element, R> { private List<ItemReader<Element, R>> readers = new ArrayList<>(); public JDom2Reader(List<ItemReader<Element, R>> readers) { this.readers = readers; } @Override public List<ItemReader<Element, R>> getIte...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
public TransformResult<Element> transform(TransformContext<Element, R> transformContext) {
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/reader/JDom2Reader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
import java.util.ArrayList; import java.util.List; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stax.StAXSource; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.transform.JDOMResul...
package com.giffing.easyxml.jdom2.reader; public class JDom2Reader<R> implements Reader<Element, R> { private List<ItemReader<Element, R>> readers = new ArrayList<>(); public JDom2Reader(List<ItemReader<Element, R>> readers) { this.readers = readers; } @Override public List<ItemReader<Element, R>> getIte...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
public TransformResult<Element> transform(TransformContext<Element, R> transformContext) {
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/reader/JDom2Reader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
import java.util.ArrayList; import java.util.List; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stax.StAXSource; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.transform.JDOMResul...
package com.giffing.easyxml.jdom2.reader; public class JDom2Reader<R> implements Reader<Element, R> { private List<ItemReader<Element, R>> readers = new ArrayList<>(); public JDom2Reader(List<ItemReader<Element, R>> readers) { this.readers = readers; } @Override public List<ItemReader<Element, R>> getIte...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
return new JDom2TransformerResult(document.getRootElement());
MarcGiffing/easyxml
easyxml-core/src/main/java/com/giffing/easyxml/reader/item/ItemReader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import com.giffing.easyxml.context.ParseContext;
package com.giffing.easyxml.reader.item; public interface ItemReader<T, R> { /** * @param t transform result */ R read(T t); /** * Indicates if the reader is responsible for the current context * * @param context */
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
boolean shouldHandle(ParseContext context);
MarcGiffing/easyxml
easyxml-core/src/main/java/com/giffing/easyxml/reader/Reader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
import java.util.List; import com.giffing.easyxml.context.TransformContext; import com.giffing.easyxml.context.TransformResult; import com.giffing.easyxml.reader.item.ItemReader;
package com.giffing.easyxml.reader; public interface Reader<T, R> { List<ItemReader<T, R>> getItemReaders();
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
TransformResult<T> transform(TransformContext<T, R> transformContext);
MarcGiffing/easyxml
easyxml-core/src/main/java/com/giffing/easyxml/reader/Reader.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
import java.util.List; import com.giffing.easyxml.context.TransformContext; import com.giffing.easyxml.context.TransformResult; import com.giffing.easyxml.reader.item.ItemReader;
package com.giffing.easyxml.reader; public interface Reader<T, R> { List<ItemReader<T, R>> getItemReaders();
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/TransformContext.java // public class TransformContext<T, R> { // // private XMLStreamReader streamReader; // // private ItemReader<T, R> itemReader; // // public TransformContext(XMLStreamReader streamReader, ItemReader<T, R> itemReader) { // this...
TransformResult<T> transform(TransformContext<T, R> transformContext);
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/writer/context/Jdom2WriterContext.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import org.jdom2.Element; import com.giffing.easyxml.context.ParseContext;
package com.giffing.easyxml.jdom2.writer.context; public class Jdom2WriterContext { private Element element;
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
private ParseContext context;
MarcGiffing/easyxml
easyxml-jdom2/src/main/java/com/giffing/easyxml/jdom2/writer/Jdom2WriterBuilder.java
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
import java.io.InputStream; import java.io.OutputStream; import javax.xml.stream.XMLStreamReader; import org.jdom2.output.Format; import com.giffing.easyxml.context.ParseContext; import com.giffing.easyxml.reader.item.ItemReader;
public Writer build() { return writer; } public Jdom2WriterBuilder<C> setFormat(Format format) { this.writer.setFormat(format); return this; } public Jdom2WriterBuilder<C> setInputStream(InputStream inputStream) { this.writer.setInputStream(inputStream); return this; } public Jdom2WriterBuilder<C>...
// Path: easyxml-core/src/main/java/com/giffing/easyxml/context/ParseContext.java // public class ParseContext { // // /** // * The current xml element path divided by slash // */ // private String path; // // public String getPath() { // return path; // } // // public void setPath(String path) { // th...
public Jdom2WriterBuilder<C> addStaxItemReader(ItemReader<XMLStreamReader, Void> itemReader) {
kuri65536/python-for-android
android/Python3ForAndroid/src/com/googlecode/python3forandroid/Python3Installer.java
// Path: android/PythonCommon/src/com/googlecode/android_scripting/pythoncommon/PythonConstants.java // public class PythonConstants { // static public final String ACTION_FILE_BROWSER = "com.googlecode.pythonforandroid.action.FILEBROWSER"; // static public final String SL4A = "com.googlecode.android_scripting"; ...
import java.io.File; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.preference.PreferenceManager; import com.googlecode.android_scripting.AsyncTaskListener; import com.googlecode.android_scripting.InterpreterInstaller; import com...
} } @Override protected boolean isInstalled() { if (mPreferences == null) { mPreferences = PreferenceManager.getDefaultSharedPreferences(mContext); if (mDescriptor instanceof Python3Descriptor) { ((Python3Descriptor) mDescriptor).setSharedPreferences(mPreferences); } } r...
// Path: android/PythonCommon/src/com/googlecode/android_scripting/pythoncommon/PythonConstants.java // public class PythonConstants { // static public final String ACTION_FILE_BROWSER = "com.googlecode.pythonforandroid.action.FILEBROWSER"; // static public final String SL4A = "com.googlecode.android_scripting"; ...
editor.putInt(PythonConstants.INSTALLED_VERSION_KEY, descriptor.getVersion());
kecskemeti/dissect-cf
src/main/java/hu/mta/sztaki/lpds/cloud/simulator/io/StorageObject.java
// Path: src/main/java/hu/mta/sztaki/lpds/cloud/simulator/util/SeedSyncer.java // public class SeedSyncer { // /** // * The random generator that will be used by the system components and that // * is recommended to be used by simulations built on top of DISSECT-CF // */ // public static final Random centralRnd...
import hu.mta.sztaki.lpds.cloud.simulator.util.SeedSyncer;
/* * ======================================================================== * DIScrete event baSed Energy Consumption simulaTor * for Clouds and Federations (DISSECT-CF) * ======================================================================== * * This file is part of DISSECT-CF. *...
// Path: src/main/java/hu/mta/sztaki/lpds/cloud/simulator/util/SeedSyncer.java // public class SeedSyncer { // /** // * The random generator that will be used by the system components and that // * is recommended to be used by simulations built on top of DISSECT-CF // */ // public static final Random centralRnd...
size = 500000000L + (long) (SeedSyncer.centralRnd.nextDouble() * 19500000000L);
Tangyingqi/Jiemian
app/src/main/java/com/tyq/jiemian/ui/callback/ZhihuApi.java
// Path: app/src/main/java/com/tyq/jiemian/bean/NewsEntity.java // public class NewsEntity implements Parcelable { // // private String date; // // private ArrayList<StoriesEntity> stories; // // private List<TopStoriesEntity> top_stories; // // // public void setDate(String date) { // this...
import com.tyq.jiemian.bean.NewsEntity; import com.tyq.jiemian.bean.StoryDetailsEntity; import retrofit2.http.GET; import retrofit2.http.Path; import rx.Observable;
package com.tyq.jiemian.ui.callback; /** * Created by diff on 2016/2/16. */ public interface ZhihuApi { @GET("api/4/news/latest")
// Path: app/src/main/java/com/tyq/jiemian/bean/NewsEntity.java // public class NewsEntity implements Parcelable { // // private String date; // // private ArrayList<StoriesEntity> stories; // // private List<TopStoriesEntity> top_stories; // // // public void setDate(String date) { // this...
Observable<NewsEntity> getLastestNews();