<commit_before>package com.sharefile.api.utils;

import java.util.ArrayList;
import java.util.Locale;

import com.sharefile.api.SFV3Error;
import com.sharefile.api.interfaces.ISFQuery;
import com.sharefile.api.interfaces.SFApiResponseListener;
import com.sharefile.api.models.SFODataObject;

public class Utils 
{
	public static String getAcceptLanguageString()
	{
		Locale currentLocale = Locale.getDefault();
	    String acceptLanguageString = currentLocale.toString().replace('_', '-') + ";q=0.8,en;q=0.6";
	    return acceptLanguageString;
	}
		
	public static <T extends SFODataObject> void safeCallErrorListener(SFApiResponseListener<T> mListener, SFV3Error error, ISFQuery<T> sfapiApiqueri)
	{
		if(mListener!=null)
		{
			mListener.sfApiError(error, sfapiApiqueri);
		}	
	}
		
	public static <T extends SFODataObject> void safeCallSuccess(SFApiResponseListener<T> listener, T object)
	{
		if(listener!=null)
		{
			listener.sfApiSuccess(object);
		}	
	}
	
	public static String parseV3IDFromURL(String url)
	{
		   String ret = "";
		   
		   if(url!=null && url.length()>2)
		   {
			   int startIndex = url.indexOf("/Items(");
			   int endIndex = url.indexOf(")");
			   if(startIndex>0)
			   {
				   ret = url.substring(startIndex + 7,endIndex);
			   }
		   }
		   
		   return ret;
	}
	
	public static boolean isEmpty(String str)
	{
		boolean ret = false;
		
		if(str == null || str.length() ==0 )
		{
			ret = true;
		}
		
		return ret;
	}

    public static boolean isEmpty(ArrayList arrayList)
    {
        boolean ret = false;

        if(arrayList == null || arrayList.size() ==0 )
        {
            ret = true;
        }

        return ret;
    }

    public static boolean isConnectorGroup(String id)
    {
        return id.indexOf("c-")==0;
    }
}<commit_msg>Add simple Util function to SDK<commit_after>package com.sharefile.api.utils;

import java.net.URI;
import java.util.ArrayList;
import java.util.Locale;

import com.sharefile.api.SFV3Error;
import com.sharefile.api.interfaces.ISFQuery;
import com.sharefile.api.interfaces.SFApiResponseListener;
import com.sharefile.api.models.SFODataObject;

public class Utils 
{
	public static String getAcceptLanguageString()
	{
		Locale currentLocale = Locale.getDefault();
	    String acceptLanguageString = currentLocale.toString().replace('_', '-') + ";q=0.8,en;q=0.6";
	    return acceptLanguageString;
	}
		
	public static <T extends SFODataObject> void safeCallErrorListener(SFApiResponseListener<T> mListener, SFV3Error error, ISFQuery<T> sfapiApiqueri)
	{
		if(mListener!=null)
		{
			mListener.sfApiError(error, sfapiApiqueri);
		}	
	}
		
	public static <T extends SFODataObject> void safeCallSuccess(SFApiResponseListener<T> listener, T object)
	{
		if(listener!=null)
		{
			listener.sfApiSuccess(object);
		}	
	}
	
	public static String parseV3IDFromURL(String url)
	{
		   String ret = "";
		   
		   if(url!=null && url.length()>2)
		   {
			   int startIndex = url.indexOf("/Items(");
			   int endIndex = url.indexOf(")");
			   if(startIndex>0)
			   {
				   ret = url.substring(startIndex + 7,endIndex);
			   }
		   }
		   
		   return ret;
	}

    public static String parseV3IDFromURL(URI url)
    {
        if(url == null)
        {
             return null;
        }

        return parseV3IDFromURL(url.toString());
    }

	public static boolean isEmpty(String str)
	{
		boolean ret = false;
		
		if(str == null || str.length() ==0 )
		{
			ret = true;
		}
		
		return ret;
	}

    public static boolean isEmpty(ArrayList arrayList)
    {
        boolean ret = false;

        if(arrayList == null || arrayList.size() ==0 )
        {
            ret = true;
        }

        return ret;
    }

    public static boolean isConnectorGroup(String id)
    {
        return id.indexOf("c-")==0;
    }
}
{'fraction_non_alphanumeric': 0.11934805467928496, 'fraction_numerical': 0.007360672975814932, 'mean_word_length': 2.894575230296827, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2973982', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1244, 'n_words': 252}