code
stringlengths
73
34.1k
label
stringclasses
1 value
public void notifySipApplicationSessionListeners(SipApplicationSessionEventType sipApplicationSessionEventType) { List<SipApplicationSessionListener> listeners = sipContext.getListeners().getSipApplicationSessionListeners(); if(listeners.size() > 0) { ClassLoader oldClassLoader = java.lang.Thread.currentT...
java
public Set<MobicentsSipSession> getSipSessions(boolean internal) { Set<MobicentsSipSession> retSipSessions = new HashSet<MobicentsSipSession>(); if(sipSessions != null) { for(SipSessionKey sipSessionKey : sipSessions) { MobicentsSipSession sipSession = sipContext.getSipManager().getSipSession(sipSessionK...
java
public void addServletTimer(ServletTimer servletTimer){ if(servletTimers == null) { servletTimers = new ConcurrentHashMap<String, ServletTimer>(1); } servletTimers.putIfAbsent(servletTimer.getId(), servletTimer); }
java
public void removeServletTimer(ServletTimer servletTimer, boolean updateAppSessionReadyToInvalidateState){ if(servletTimers != null) { servletTimers.remove(servletTimer.getId()); } if(updateAppSessionReadyToInvalidateState) { updateReadyToInvalidateState(); } }
java
public JSONObject jsonify() { JSONObject ret = new JSONObject(); ret.put("title", getTitle()); ret.put("category", getCategory()); ret.put("subcategory", getSubCategory()); ret.put("description", getDescription()); if (null != this._extraAttributes && !this._extraAttributes.isEmpty()) { re...
java
private ClientCCASession getRoSession() throws InternalException { return ((ISessionFactory) super.sessionFactory).getNewAppSession(null, roAppId, ClientCCASession.class, null); }
java
private JCreditControlRequest createCCR(int ccRequestType, String subscriptionId, String serviceContextId) throws Exception { ClientCCASession roSession = roSessions.get(serviceContextId); // Create Credit-Control-Request JCreditControlRequest ccr = createCreditControlRequest(roSession.getSessions().ge...
java
public void clean() { this.sipApplicationSessionAttributeListeners.clear(); this.sipApplicationSessionBindingListeners.clear(); this.sipApplicationSessionActivationListeners.clear(); this.sipApplicationSessionListeners.clear(); this.sipSessionActivationListeners.clear(); this.sipSessionAttributeListeners...
java
public void onBranchTerminated() { if(outgoingRequest != null) { String txid = ((ViaHeader) outgoingRequest.getMessage().getHeader(ViaHeader.NAME)).getBranch(); proxy.removeTransaction(txid); } }
java
public void start() { if(logger.isDebugEnabled()) { logger.debug("start"); } if(started) { throw new IllegalStateException("Proxy branch alredy started!"); } if(canceled) { throw new IllegalStateException("Proxy branch was cancelled, you must create a new branch!"); } if(timedOut) { throw n...
java
public void cancelTimer() { synchronized (cTimerLock) { if (proxyTimeoutTask != null && proxyBranchTimerStarted) { proxyTimeoutTask.cancel(); proxyTimeoutTask = null; proxyBranchTimerStarted = false; } } }
java
public void cancel1xxTimer() { if (proxy1xxTimeoutTask != null && proxyBranch1xxTimerStarted) { proxy1xxTimeoutTask.cancel(); proxy1xxTimeoutTask = null; proxyBranch1xxTimerStarted = false; } }
java
@Override public void begin(String namespaceURI, String name, Attributes attributes) throws Exception { XMLReader xmlReader = getDigester().getXMLReader(); Document doc = documentBuilder.newDocument(); NodeBuilder builder = null; if (nodeType == Node.ELEMENT_NODE) { ...
java
public T friends_areFriends(int userId1, int userId2) throws FacebookException, IOException { return this.callMethod(FacebookMethod.FRIENDS_ARE_FRIENDS, new Pair<String, CharSequence>("uids1", Integer.toString(userId1)), new Pair<String, CharSequence>("uids2...
java
public T profile_getFBML(Integer userId) throws FacebookException, IOException { return this.callMethod(FacebookMethod.PROFILE_GET_FBML, new Pair<String, CharSequence>("uid", Integer.toString(userId))); }
java
protected void handleFeedImages(List<Pair<String, CharSequence>> params, Collection<IFeedImage> images) { if (images != null && images.size() > 4) { throw new IllegalArgumentException("At most four images are allowed, got " + Integer.t...
java
public boolean feed_publishTemplatizedAction(Integer actorId, CharSequence titleTemplate) throws FacebookException, IOException { if (null != actorId && actorId != this._userId) { throw new IllegalArgumentException("Actor ID parameter is deprecated"); } return feed_publishTemplatizedAction(titleTe...
java
public T groups_getMembers(Number groupId) throws FacebookException, IOException { assert (null != groupId); return this.callMethod(FacebookMethod.GROUPS_GET_MEMBERS, new Pair<String, CharSequence>("gid", groupId.toString())); }
java
public T events_getMembers(Number eventId) throws FacebookException, IOException { assert (null != eventId); return this.callMethod(FacebookMethod.EVENTS_GET_MEMBERS, new Pair<String, CharSequence>("eid", eventId.toString())); }
java
public T fql_query(CharSequence query) throws FacebookException, IOException { assert (null != query); return this.callMethod(FacebookMethod.FQL_QUERY, new Pair<String, CharSequence>("query", query)); }
java
public T photos_getTags(Collection<Long> photoIds) throws FacebookException, IOException { return this.callMethod(FacebookMethod.PHOTOS_GET_TAGS, new Pair<String, CharSequence>("pids", delimit(photoIds))); }
java
public T groups_get(Integer userId, Collection<Long> groupIds) throws FacebookException, IOException { boolean hasGroups = (null != groupIds && !groupIds.isEmpty()); if (null != userId) return hasGroups ? this.callMethod(FacebookMethod.GROUPS_GET, new Pair<String, CharSequence>("uid", use...
java
public boolean fbml_refreshRefUrl(URL url) throws FacebookException, IOException { return extractBoolean(this.callMethod(FacebookMethod.FBML_REFRESH_REF_URL, new Pair<String, CharSequence>("url", url.toString()))); }
java
public T users_getInfo(Collection<Integer> userIds, EnumSet<ProfileField> fields) throws FacebookException, IOException { // assertions test for invalid params assert (userIds != null); assert (fields != null); assert (!fields.isEmpty()); return this.callMethod(FacebookMethod.USERS_GET_INFO, ...
java
public int users_getLoggedInUser() throws FacebookException, IOException { T result = this.callMethod(FacebookMethod.USERS_GET_LOGGED_IN_USER); return extractInt(result); }
java
public int auth_getUserId(String authToken) throws FacebookException, IOException { /* * Get the session information if we don't have it; this will populate * the user ID as well. */ if (null == this._sessionKey) auth_getSession(authToken); return this._userId; }
java
public boolean users_hasAppPermission(CharSequence permission) throws FacebookException, IOException { return extractBoolean(this.callMethod(FacebookMethod.USERS_HAS_APP_PERMISSION, new Pair<String, CharSequence>("ext_perm", permission))); }
java
public boolean users_setStatus(String status) throws FacebookException, IOException { return extractBoolean(this.callMethod(FacebookMethod.USERS_SET_STATUS, new Pair<String, CharSequence>("status", status))); }
java
public boolean users_clearStatus() throws FacebookException, IOException { return extractBoolean(this.callMethod(FacebookMethod.USERS_SET_STATUS, new Pair<String, CharSequence>("clear", "1"))); }
java
public void notifications_send(Collection<Integer> recipientIds, CharSequence notification) throws FacebookException, IOException { assert (null != notification); ArrayList<Pair<String, CharSequence>> args = new ArrayList<Pair<String, CharSequence>>(3); if (null != recipientIds && !recipientIds.isEmpty(...
java
public T photos_addTags(Long photoId, Collection<PhotoTag> tags) throws FacebookException, IOException { assert (photoId > 0); assert (null != tags && !tags.isEmpty()); JSONArray jsonTags = new JSONArray(); for (PhotoTag tag : tags) { jsonTags.add(tag.jsonify()); } return this.callMe...
java
public T events_get(Integer userId, Collection<Long> eventIds, Long startTime, Long endTime) throws FacebookException, IOException { ArrayList<Pair<String, CharSequence>> params = new ArrayList<Pair<String, CharSequence>>(FacebookMethod.EVENTS_GET.numParams()); boolean hasUserId = null != userId && 0...
java
public boolean profile_setFBML(CharSequence fbmlMarkup, Integer userId) throws FacebookException, IOException { return extractBoolean(this.callMethod(FacebookMethod.PROFILE_SET_FBML, new Pair<String, CharSequence>("uid", Integer.toString(userId)), ...
java
public boolean profile_setProfileFBML(CharSequence fbmlMarkup) throws FacebookException, IOException { return profile_setFBML(fbmlMarkup, /* profileActionFbmlMarkup */null, /* mobileFbmlMarkup */null, /* profileId */null); }
java
public boolean profile_setProfileActionFBML(CharSequence fbmlMarkup) throws FacebookException, IOException { return profile_setFBML( /* profileFbmlMarkup */null, fbmlMarkup, /* mobileFbmlMarkup */null, /* profileId */null); }
java
public boolean profile_setMobileFBML(CharSequence fbmlMarkup) throws FacebookException, IOException { return profile_setFBML( /* profileFbmlMarkup */null, /* profileActionFbmlMarkup */null, fbmlMarkup, /* profileId */null); }
java
public boolean profile_setFBML(CharSequence profileFbmlMarkup, CharSequence profileActionFbmlMarkup) throws FacebookException, IOException { return profile_setFBML(profileFbmlMarkup, profileActionFbmlMarkup, /* mobileFbmlMarkup */null, /* profileId */null); }
java
public T photos_getAlbums(Collection<Long> albumIds) throws FacebookException, IOException { return photos_getAlbums(null, /*userId*/albumIds); }
java
public boolean fbml_refreshImgSrc(URL imageUrl) throws FacebookException, IOException { return extractBoolean(this.callMethod(FacebookMethod.FBML_REFRESH_IMG_SRC, new Pair<String, CharSequence>("url", ...
java
public String auth_createToken() throws FacebookException, IOException { T d = this.callMethod(FacebookMethod.AUTH_CREATE_TOKEN); return extractString(d); }
java
public Long marketplace_createListing(Boolean showOnProfile, MarketplaceListing attrs) throws FacebookException, IOException { T result = this.callMethod(FacebookMethod.MARKETPLACE_CREATE_LISTING, new Pair<String, CharSequence>("show_on_profile", showOnProfile ? "1" : "0"), ...
java
public boolean marketplace_removeListing(Long listingId, CharSequence status) throws FacebookException, IOException { assert MARKETPLACE_STATUS_DEFAULT.equals(status) || MARKETPLACE_STATUS_SUCCESS.equals(status) || MARKETPLACE_STATUS_NOT_SUCCESS.equals(status) : "Invalid status: " + status; T result ...
java
public T marketplace_getSubCategories(CharSequence category) throws FacebookException, IOException { return this.callMethod(FacebookMethod.MARKETPLACE_GET_SUBCATEGORIES, new Pair<String, CharSequence>("category", category)); }
java
public boolean pages_isAppAdded(Long pageId) throws FacebookException, IOException { return extractBoolean(this.callMethod(FacebookMethod.PAGES_IS_APP_ADDED, new Pair<String,CharSequence>("page_id", pageId.toString()))); }
java
public boolean admin_setAppProperties(ApplicationPropertySet properties) throws FacebookException, IOException { if (null == properties || properties.isEmpty()) { throw new IllegalArgumentException("expecting a non-empty set of application properties"); } return extractBoolean(this.callMethod(Fac...
java
public void init() { // load the configuration file String darConfigurationFileLocation = getDarConfigurationFileLocation(); if (log.isDebugEnabled()) { log.debug("Default Application Router file Location : " + darConfigurationFileLocation); } File darConfigurat...
java
public Map<String, List<? extends SipApplicationRouterInfo>> parse() throws ParseException { Map<String, List<? extends SipApplicationRouterInfo>> sipApplicationRoutingInfo = new HashMap<String, List<? extends SipApplicationRouterInfo>>(); Iterator darEntriesIterator = properties.entrySet().iterator...
java
public Map<String, List<? extends SipApplicationRouterInfo>> parse(String configuration) throws ParseException { Properties tempProperties = new Properties(); // tempProperties.load(new StringReader(configuration)); // This needs Java 1.6 ByteArrayInputStream stringStream = new ByteArrayInput...
java
public Map<String, List<? extends SipApplicationRouterInfo>> parse(Properties properties) throws ParseException { this.properties = properties; return parse(); }
java
protected void registerJMX(StandardContext ctx) { ObjectName oname; String parentName = ctx.getName(); parentName = ("".equals(parentName)) ? "/" : parentName; String hostName = ctx.getParent().getName(); hostName = (hostName==null) ? "DEFAULT" : hostName; String ...
java
private void checkHandler(SipServletRequest request) { MobicentsSipSession sipSessionImpl = (MobicentsSipSession)request.getSession(); if(sipSessionImpl.getHandler() == null) { try { sipSessionImpl.setHandler(sipContext.getServletHandler()); // ((SipApplicationSessionImpl)sipSessionImpl.getApplicationSess...
java
private BigDecimal round(BigDecimal amount) { return new BigDecimal(amount.movePointRight(2).add(new BigDecimal(".5")).toBigInteger()).movePointLeft(2); }
java
private long doDiameterCharging(String sessionId, String userId, Long cost, boolean refund) { try { logger.info( "Creating Diameter Charging " + (refund ? "Refund" : "Debit") + " Request UserId[" + userId + "], Cost[" + cost + "]..." ); Request req = (Request) diameterBaseClient.createAccount...
java
public void addSipApplicationListener(String listener) { if(logger.isDebugEnabled()) { logger.debug("addSipApplicationListener " + getName()); } sipApplicationListeners.add(listener); fireContainerEvent("addSipApplicationListener", listener); // FIXME - add instance if already started? ...
java
public void addAllToCart() { for (Product item : searchResults) { Boolean selected = searchSelections.get(item); if (selected != null && selected) { searchSelections.put(item, false); cart.addProduct(item, 1); } } }
java
private void postWorkDirectory() { // Acquire (or calculate) the work directory path String workDir = getWorkDir(); if (workDir == null || workDir.length() == 0) { // Retrieve our parent (normally a host) name String hostName = null; String engineName = null...
java
public static boolean verifySignature(EnumMap<FacebookParam, CharSequence> params, String secret) { if (null == params || params.isEmpty() ) return false; CharSequence sigParam = params.remove(FacebookParam.SIGNATURE); return (null == sigParam) ? false : verifySignature(params, secret, sigParam.toStri...
java
public static boolean isValidIPV4Address(String value) { int periods = 0; int i = 0; int length = value.length(); if (length > 15) return false; char c = 0; String word = ""; for (i = 0; i < length; i++) { c = value.charAt(i); ...
java
public String extractString(Object val) { try { return (String) val; } catch (ClassCastException cce) { logException(cce); return null; } }
java
protected Object parseCallResult(InputStream data, IFacebookMethod method) throws FacebookException, IOException { Object json = JSONValue.parse(new InputStreamReader(data)); if (isDebug()) { log(method.methodName() + ": " + (null != json ? json.toString() : "null")); } if (json instanceof JS...
java
protected URL extractURL(Object url) throws IOException { if (!(url instanceof String)) { return null; } return (null == url || "".equals(url)) ? null : new URL( (String) url); }
java
protected boolean extractBoolean(Object val) { try { return (Boolean) val; } catch (ClassCastException cce) { logException(cce); return false; } }
java
protected Long extractLong(Object val) { try { return (Long) val; } catch (ClassCastException cce) { logException(cce); return null; } }
java
public void add(double lat, double lon, long time, T t, Optional<R> id) { Info<T, R> info = new Info<T, R>(lat, lon, time, t, id); add(info); }
java
public void add(Info<T, R> info) { String hash = GeoHash.encodeHash(info.lat(), info.lon()); addToMap(mapByGeoHash, info, hash); addToMapById(mapById, info, hash); }
java
public static long decodeBase32(String hash) { boolean isNegative = hash.startsWith("-"); int startIndex = isNegative ? 1 : 0; long base = 1; long result = 0; for (int i = hash.length() - 1; i >= startIndex; i--) { int j = getCharIndex(hash.charAt(i)); res...
java
private static Map<Direction, Map<Parity, String>> createBorders() { Map<Direction, Map<Parity, String>> m = createDirectionParityMap(); m.get(Direction.RIGHT).put(Parity.EVEN, "bcfguvyz"); m.get(Direction.LEFT).put(Parity.EVEN, "0145hjnp"); m.get(Direction.TOP).put(Parity.EVEN, "prxz")...
java
private static Map<Direction, Map<Parity, String>> createDirectionParityMap() { Map<Direction, Map<Parity, String>> m = newHashMap(); m.put(Direction.BOTTOM, GeoHash.<Parity, String> newHashMap()); m.put(Direction.TOP, GeoHash.<Parity, String> newHashMap()); m.put(Direction.LEFT, GeoHash...
java
private static void addOddParityEntries(Map<Direction, Map<Parity, String>> m) { m.get(Direction.BOTTOM).put(Parity.ODD, m.get(Direction.LEFT).get(Parity.EVEN)); m.get(Direction.TOP).put(Parity.ODD, m.get(Direction.RIGHT).get(Parity.EVEN)); m.get(Direction.LEFT).put(Parity.ODD, m.get(Direction.B...
java
public static List<String> neighbours(String hash) { List<String> list = new ArrayList<String>(); String left = adjacentHash(hash, Direction.LEFT); String right = adjacentHash(hash, Direction.RIGHT); list.add(left); list.add(right); list.add(adjacentHash(hash, Direction.T...
java
public static String encodeHash(LatLong p, int length) { return encodeHash(p.getLat(), p.getLon(), length); }
java
static String fromLongToString(long hash) { int length = (int) (hash & 0xf); if (length > 12 || length < 1) throw new IllegalArgumentException("invalid long geohash " + hash); char[] geohash = new char[length]; for (int pos = 0; pos < length; pos++) { geohash[pos]...
java
private static void refineInterval(double[] interval, int cd, int mask) { if ((cd & mask) != 0) interval[0] = (interval[0] + interval[1]) / 2; else interval[1] = (interval[0] + interval[1]) / 2; }
java
public static int hashLengthToCoverBoundingBox(double topLeftLat, double topLeftLon, double bottomRightLat, double bottomRightLon) { boolean isEven = true; double minLat = -90.0, maxLat = 90; double minLon = -180.0, maxLon = 180.0; for (int bits = 0; bits < MAX_HASH_LENGTH *...
java
public static boolean hashContains(String hash, double lat, double lon) { LatLong centre = decodeHash(hash); return Math.abs(centre.getLat() - lat) <= heightDegrees(hash.length()) / 2 && Math.abs(to180(centre.getLon() - lon)) <= widthDegrees(hash.length()) / 2; }
java
public static Coverage coverBoundingBox(double topLeftLat, final double topLeftLon, final double bottomRightLat, final double bottomRightLon, final int length) { return new Coverage(coverBoundingBoxLongs(topLeftLat, topLeftLon, bottomRightLat, bottomRightLon, length)); }
java
private static double calculateWidthDegrees(int n) { double a; if (n % 2 == 0) a = -1; else a = -0.5; double result = 180 / Math.pow(2, 2.5 * n + a); return result; }
java
public static String gridAsString(String hash, int fromRight, int fromBottom, int toRight, int toBottom) { return gridAsString(hash, fromRight, fromBottom, toRight, toBottom, Collections.<String> emptySet()); }
java
public void setLocation(String latitude, String longitude) { this.latitude = new BigDecimal(latitude); this.longitude = new BigDecimal(longitude); }
java
private BigDecimal getLongitudeHour(Calendar date, Boolean isSunrise) { int offset = 18; if (isSunrise) { offset = 6; } BigDecimal dividend = BigDecimal.valueOf(offset).subtract(getBaseLongitudeHour()); BigDecimal addend = divideBy(dividend, BigDecimal.valueOf(24)); ...
java
private BigDecimal getMeanAnomaly(BigDecimal longitudeHour) { BigDecimal meanAnomaly = multiplyBy(new BigDecimal("0.9856"), longitudeHour).subtract(new BigDecimal("3.289")); return setScale(meanAnomaly); }
java
public static Calendar getSunrise(double latitude, double longitude, TimeZone timeZone, Calendar date, double degrees) { SolarEventCalculator solarEventCalculator = new SolarEventCalculator(new Location(latitude, longitude), timeZone); return solarEventCalculator.computeSunriseCalendar(new Zenith(90 - d...
java
public static Calendar getSunset(double latitude, double longitude, TimeZone timeZone, Calendar date, double degrees) { SolarEventCalculator solarEventCalculator = new SolarEventCalculator(new Location(latitude, longitude), timeZone); return solarEventCalculator.computeSunsetCalendar(new Zenith(90 - deg...
java
private static synchronized void closeRegisteredConnections() { for (Connection connection : activeConnections) { LOGGER.log(Level.INFO, "Forcing connection to {0}:{1} closed.", new Object[]{connection.getHostname(), connection.getPort()}); // force closed just in cas...
java
public List<String> getJavas(SlaveComputer computer, TaskListener listener, Connection connection) { return getJavas(listener,connection); }
java
private void cleanupConnection(TaskListener listener) { // we might be called multiple times from multiple finally/catch block, if (connection!=null) { connection.close(); connection = null; listener.getLogger().println(Messages.SSHLauncher_ConnectionClosed(getTimest...
java
private void verifyNoHeaderJunk(TaskListener listener) throws IOException, InterruptedException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); connection.exec("exit 0",baos); final String s; //TODO: Seems we need to retrieve the encoding from the connection destination ...
java
private void startAgent(SlaveComputer computer, final TaskListener listener, String java, String workingDirectory) throws IOException { session = connection.openSession(); expandChannelBufferSize(session,listener); String cmd = "cd \"" + workingDirectory + "\" && " + ...
java
private void copyAgentJar(TaskListener listener, String workingDirectory) throws IOException, InterruptedException { String fileName = workingDirectory + SLASH_AGENT_JAR; listener.getLogger().println(Messages.SSHLauncher_StartingSFTPClient(getTimestamp())); SFTPClient sftpClient = null; ...
java
static String getMd5Hash(byte[] bytes) throws NoSuchAlgorithmException { String hash; try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(bytes); byte[] digest = md.digest(); char[] hexCode = "0123456789ABCDEF".toCharArray(); ...
java
static byte[] readInputStreamIntoByteArrayAndClose(InputStream inputStream) throws IOException { byte[] bytes = null; try{ bytes = ByteStreams.toByteArray(inputStream); }catch(IOException e){ throw e; } finally { IOUtils.closeQuietly(inputStream); ...
java
private void copySlaveJarUsingSCP(TaskListener listener, String workingDirectory) throws IOException, InterruptedException { SCPClient scp = new SCPClient(connection); try { // check if the working directory exists if (connection.exec("test -d " + workingDirectory ,listener.getLo...
java
private boolean reportTransportLoss(Connection c, TaskListener listener) { Throwable cause = c.getReasonClosedCause(); if (cause != null) { cause.printStackTrace(listener.error("Socket connection to SSH server was lost")); } return cause != null; }
java
private String getSessionOutcomeMessage(Session session, boolean isConnectionLost) throws InterruptedException { session.waitForCondition(ChannelCondition.EXIT_STATUS | ChannelCondition.EXIT_SIGNAL, 3000); Integer exitCode = session.getExitStatus(); if (exitCode != null) return "Sla...
java
static TrileadVersionSupport getTrileadSupport() { try { if (isAfterTrilead8()) { return createVersion9Instance(); } } catch (Exception | LinkageError e) { LOGGER.log(Level.WARNING, "Could not create Trilead support class. Using legacy Trilead features...
java
protected String resolveJava() throws InterruptedException, IOException { for (JavaProvider provider : JavaProvider.all()) { for (String javaCommand : provider.getJavas(computer, listener, connection)) { LOGGER.fine("Trying Java at " + javaCommand); try { ...
java
public HostKey getHostKey(Computer host) throws IOException { HostKey key = cache.get(host); if (null == key) { File hostKeyFile = getSshHostKeyFile(host.getNode()); if (hostKeyFile.exists()) { XmlFile xmlHostKeyFile = new XmlFile(hostKeyFile); key...
java
public void saveHostKey(Computer host, HostKey hostKey) throws IOException { XmlFile xmlHostKeyFile = new XmlFile(getSshHostKeyFile(host.getNode())); xmlHostKeyFile.write(hostKey); cache.put(host, hostKey); }
java
public void mkdirs(String path, int posixPermission) throws IOException { SFTPv3FileAttributes atts = _stat(path); if (atts!=null && atts.isDirectory()) return; int idx = path.lastIndexOf('/'); if (idx>0) mkdirs(path.substring(0,idx), posixPermission); t...
java
public void chmod(String path, int permissions) throws IOException { SFTPv3FileAttributes atts = new SFTPv3FileAttributes(); atts.permissions = permissions; setstat(path, atts); }
java