Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Java Web API Examples

Primary Categories

AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
ETrade
Facebook
GeoOp
GetHarvest
Jira

MYOB
Magento
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
PayPal
Peoplevox
Populi
QuickBooks
SOAP finkok.com
Shopify
Stripe
SugarCRM
Trello
Twitter
VoiceBase
Vonage
Walmart
Xero
eBay
effectconnect

 

 

 

(Java) Download a Jira Attachment

Demonstrates how to download a Jira attachment to a file.

Chilkat Java Downloads

Java Libs for Windows, Linux, Alpine Linux,
MAC OS X, Solaris, FreeBSD, OpenBSD,
Raspberry Pi and other single board computers

Java Libs for Android

import com.chilkatsoft.*;

public class ChilkatExample {

  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[])
  {
    // This example requires the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttp http = new CkHttp();

    http.put_FollowRedirects(true);

    // Provide the username/password for authentication
    http.put_Login("jira@example.com");
    http.put_Password("JIRA_API_TOKEN");

    // The URL for a Jira attachment has this format: 
    // https://your-domain.atlassian.net/secure/attachment/{attachment_id}/{attachment_filename}

    String url = "https://chilkat.atlassian.net/secure/attachment/10001/starfish.jpg";
    String localFilePath = "qa_output/starfish.jpg";
    boolean success = http.Download(url,localFilePath);
    if (success != true) {
        System.out.println(http.lastErrorText());
        return;
        }

    System.out.println("Successfully downloaded Jira attachment.");
  }
}

 

© 2000-2019 Chilkat Software, Inc. All Rights Reserved.